Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch a bug then write a test #70

Merged
merged 10 commits into from
Oct 11, 2024
Merged

Catch a bug then write a test #70

merged 10 commits into from
Oct 11, 2024

Conversation

drizk1
Copy link
Member

@drizk1 drizk1 commented Oct 4, 2024

Alright this PR got a little bigger than expected ... but here we are

  • Total of 62 tests

  • adds support for multiple joins using TidierDB queries to be chained together.

    • Inspiration was from this duckplyr blog post by Hannes Mühleisen .. at some point I will download the 1gb and reprex it.
    • adds tests for this too (2 left joins a well as a full join then right join)
  • adds mdy, ymd, dmy and ability to easily add time intervals

    • had to deviate a bit from tidierdata/julia logic here because of conflicts with sql ie day(1) is used in different ways for base sql for extractions, so it's just date_col + interval2days for example and it will work - not ideal but most accessible method without lot of parsing needing to be written - examples in the tests but will add docs at some point
    • will possibly go down the rabbit hole of parsing but it would require recognizing the call of - or + and then each unit of interval because the interval would otherwise conflict with the days
    • adds tests for dates, filtering on dates, conditionals with dates
  • fixes edge case with joining 2 summarized tables without any CTEs

Only for DuckDB (because other sqls dont support)

  • summarize can be used to quickly preview a table when no other args are provided ie
julia> DB.@collect DB.@summarize(DB.t(test_db))
4×12 DataFrame
 Row │ column_name  column_type  min     max     approx_unique  avg      std                 q25      q50      ⋯
     │ String       String       String  String  Int64          String?  String?             String?  String?  ⋯
─────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────
   1 │ id           VARCHAR      AA      AJ                 11  missing  missing             missing  missing  ⋯
   2 │ groups       VARCHAR      aa      bb                  2  missing  missing             missing  missing 
   3 │ value        BIGINT       1       5                   5  3.0      1.4907119849998598  2        3
   4 │ percent      DOUBLE       0.1     1.0                10  0.55     0.3027650354097492  0.3      0.55
                                                                                               3 columns omitted

@drizk1 drizk1 merged commit 08db6df into main Oct 11, 2024
3 checks passed
@drizk1 drizk1 deleted the catch-a-bug-then-write-a-test branch October 13, 2024 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant