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(native-filters): Assume that temporal columns exist if column_types is undefined #15324
Conversation
) => dataset?.column_types?.includes(GenericDataType.TEMPORAL); | ||
) => dataset?.column_types?.includes(GenericDataType.TEMPORAL) ?? true; |
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.
Could we make it even more bulletproof by checking for length of column_types
? Something like !dataset?.column_types?.length || dataset?.column_types?.includes(GenericDataType.TEMPORAL)
? The reason is I suspect the Druid connector might return an empty array.
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.
Done 👍
Codecov Report
@@ Coverage Diff @@
## master #15324 +/- ##
==========================================
- Coverage 77.15% 77.15% -0.01%
==========================================
Files 973 973
Lines 50488 50491 +3
Branches 6184 6184
==========================================
+ Hits 38954 38956 +2
- Misses 11328 11329 +1
Partials 206 206
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
…es is undefined (apache#15324) * fix(native-filters): Assume that temporal columns exist if column_types is undefined * Allow column_types to be an empty array
…es is undefined (apache#15324) * fix(native-filters): Assume that temporal columns exist if column_types is undefined * Allow column_types to be an empty array
…es is undefined (apache#15324) * fix(native-filters): Assume that temporal columns exist if column_types is undefined * Allow column_types to be an empty array
SUMMARY
Currently, if for some reason backend doesn't return
column_types
field in datasets query, we disable selecting time filters in native filters modal. This PR makes the feature more foolproof, by assuming that temporal columns exist ifcolumn_types
is undefined.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION
CC @villebro @graceguo-supercat