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

Datetime extraction and arithmetics for text column in mongo #26339

Merged
merged 3 commits into from
Nov 11, 2022

Conversation

qnkhuat
Copy link
Contributor

@qnkhuat qnkhuat commented Nov 10, 2022

Datetime extraction and arithmetics were implemented in #25277 and #25414 respectively.
But at the time, Mongo hadn't supported casting a text column to datetime so some tests were skipped for Mongo.

Now we added it in #22313, we should run those tests for Mongo

@qnkhuat qnkhuat mentioned this pull request Nov 10, 2022
1 task
@qnkhuat qnkhuat added the backport Automatically create PR on current release branch on merge label Nov 10, 2022
:breakout [[:expression "expr"]]}}]]
(testing (format "%s %s function works as expected on %s column for driver %s" op unit col-type driver/*driver*)
(is (= (set expected) (set (qp.datetime-test/test-datetime-math query))))))))
(doseq [[col-type field-id] [[:datetime (mt/id :times :dt)]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move [col-type field-id] from let into doseq so we could run on multiple col-types

@@ -92,42 +92,25 @@

(deftest extraction-function-tests
(mt/dataset times-mixed
;; need to have seperate tests for mongo because it doesn't have supports for casting yet
(mt/test-drivers (disj (mt/normal-drivers-with-feature :temporal-extract) :mongo)
(mt/test-drivers (mt/normal-drivers-with-feature :temporal-extract)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before this, we had duplicated testing for mongo because they don't have supports for casting, but now those test will be merged together.

So even though we're deleting code, we actually running more tests here.

@codecov
Copy link

codecov bot commented Nov 10, 2022

Codecov Report

Base: 64.29% // Head: 64.29% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (84d37fd) compared to base (14ca69b).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #26339   +/-   ##
=======================================
  Coverage   64.29%   64.29%           
=======================================
  Files        3149     3149           
  Lines       92258    92259    +1     
  Branches    11704    11702    -2     
=======================================
+ Hits        59316    59318    +2     
- Misses      28254    28255    +1     
+ Partials     4688     4686    -2     
Flag Coverage Δ
back-end 85.57% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...c/metabase/query_processor/middleware/annotate.clj 82.03% <0.00%> (-0.40%) ⬇️
src/metabase/models/query.clj 92.30% <0.00%> (ø)
src/metabase/driver/sql/query_processor.clj 85.82% <0.00%> (+0.19%) ⬆️
shared/src/metabase/mbql/util.cljc 82.58% <0.00%> (+0.49%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@qnkhuat qnkhuat requested a review from a team November 10, 2022 08:48
Copy link
Member

@camsaul camsaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, works for me

Copy link
Contributor

@metamben metamben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@qnkhuat qnkhuat merged commit e2939bf into master Nov 11, 2022
@qnkhuat qnkhuat deleted the ngoc-datetime-func-for-mongo branch November 11, 2022 02:40
metabase-bot bot added a commit that referenced this pull request Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Automatically create PR on current release branch on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants