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

fix(native-filters): Assume that temporal columns exist if column_types is undefined #15324

Merged
merged 2 commits into from Jun 23, 2021

Conversation

kgabryje
Copy link
Member

@kgabryje kgabryje commented Jun 23, 2021

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 if column_types is undefined.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

CC @villebro @graceguo-supercat

Comment on lines 280 to 281
) => dataset?.column_types?.includes(GenericDataType.TEMPORAL);
) => dataset?.column_types?.includes(GenericDataType.TEMPORAL) ?? true;
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done 👍

@codecov
Copy link

codecov bot commented Jun 23, 2021

Codecov Report

Merging #15324 (c3ef0a9) into master (6324490) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            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              
Flag Coverage Δ
javascript 71.77% <100.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
...onfigModal/FiltersConfigForm/FiltersConfigForm.tsx 69.11% <100.00%> (-0.03%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6324490...c3ef0a9. Read the comment docs.

@kgabryje kgabryje closed this Jun 23, 2021
@kgabryje kgabryje reopened this Jun 23, 2021
@kgabryje kgabryje merged commit b89ee0c into apache:master Jun 23, 2021
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
…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
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
…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
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
…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
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.3.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XS 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants