-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
feat(bigquery): implement custom minute time grains #12581
Conversation
actual = BigQueryEngineSpec.get_timestamp_expr( | ||
col=col, pdf=None, time_grain="PT5M", type_=type_ | ||
) | ||
self.assertEqual(str(actual), expected) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we are using assert
instead of self.assertEqual
Codecov Report
@@ Coverage Diff @@
## master #12581 +/- ##
==========================================
- Coverage 66.75% 63.97% -2.78%
==========================================
Files 1015 486 -529
Lines 49634 29970 -19664
Branches 4839 0 -4839
==========================================
- Hits 33131 19173 -13958
+ Misses 16380 10797 -5583
+ Partials 123 0 -123
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
Tested manually - ok :) I had only problem with connection to physical table (not from sql editor). But time columns mentioned in description worked. 🟢 |
@adam-stasiak good to know - can you open a ticket about that? I'm pretty sure it's unrelated, but needs to be fixed at any rate but in a different PR. |
SUMMARY
Currently the BigQuery engine spec only supports full seconds/minutes/hours due to the dialect not natively supporting custom intervals. This PR adds support for the missing default 5, 10, 15 and 30 min grains by utilizing some custom timestamp handling functions:
Screenshot
TEST PLAN
Verified to work on
TIMESTAMP
,DATETIME
andDATE
types + added new unit tests.ADDITIONAL INFORMATION