-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
fix: create virtual table with exotic type #19714
Conversation
@@ -86,7 +83,7 @@ def get_physical_table_metadata( | |||
col.update( | |||
{ | |||
"type": "UNKNOWN", | |||
"generic_type": None, | |||
"type_generic": None, |
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.
this was a bycatch (see line 79/76 above with the correct key) when I worked on adding proper TypedDict
s for these objects (opening up separate PR for that one, but I thought it worthwhile to fix this error right away).
Codecov Report
@@ Coverage Diff @@
## master #19714 +/- ##
===========================================
- Coverage 66.51% 53.84% -12.67%
===========================================
Files 1684 1684
Lines 64560 64561 +1
Branches 6625 6630 +5
===========================================
- Hits 42939 34762 -8177
- Misses 19926 28101 +8175
- Partials 1695 1698 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
1a0268d
to
3c99eba
Compare
@@ -231,7 +219,7 @@ def load_or_create_tables( # pylint: disable=too-many-arguments | |||
name=column["name"], | |||
type=str(column["type"]), | |||
expression=conditional_quote(column["name"]), | |||
is_temporal=is_column_type_temporal(column["type"]), | |||
is_temporal=column["is_dttm"], |
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.
The previous version checked for date
, datetime
, time
and timedelta
. Is this equivalent?
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.
yes - this one is actually based on what the db engine spec says is temporal, so it's much more comprehensive (=can be customized per database).
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.
LGTM. Thanks for the fix!
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.
* fix: create virtual table with exotic type * fix test (cherry picked from commit 2b17ce2)
🏷️ preset:2022.15 |
* fix: create virtual table with exotic type * fix test
SUMMARY
This is an alternative implementation of #19701, which reuses the same data type inference logic that's already being used when creating physical datasets. While I did this fix I started adding types for the column type objects, but that turned into a HUGE rabbit hole going well beyond the scope of this PR. Therefore the changes in this PR are kept to a minimum to fix the issue at hand, but once this is merged I'll open up a PR that introduces proper types to to these code paths.
TESTING INSTRUCTIONS
select * from schema.table
ADDITIONAL INFORMATION