-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
[bugfix] temporal columns with expression fail #4890
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,3 +105,9 @@ def test_grains_dict(self): | |
self.assertEquals(d.get('day').function, 'DATE({col})') | ||
self.assertEquals(d.get('P1D').function, 'DATE({col})') | ||
self.assertEquals(d.get('Time Column').function, '{col}') | ||
|
||
def test_get_timestamp_expression(self): | ||
tbl = self.get_table_by_name('birth_names') | ||
ds_col = tbl.get_column('ds') | ||
sqla_literal = ds_col.get_timestamp_expression(None) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add a test thats passing a value into There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem is the test will fail depending on the database it's working on. I guess I can figure out which engine it's on (postgres/mysql) and do the proper assertion depending on that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or just add one test per database: |
||
self.assertEquals(str(sqla_literal.compile()), 'ds') |
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.
Isn't this line always overriding the one before? the one before should be
expr = grain.function
or there should be an else branch somewhereThere 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.
Yeah, I think this should be
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.
See #4892
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.
Yeah I think we're both wrong on this one :( , I'm going to clean this up a bit more and write many tests covering the whole function.