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(dashboard): rename native filter configuration property #13769

Merged

Conversation

villebro
Copy link
Member

@villebro villebro commented Mar 24, 2021

SUMMARY

The PR #13625 introduced a regression in the native filters feature, causing existing filter configurations to not show up on the Filter Tab and making it impossible to save affected dashboards. The reason for the regression was that the filter_configuration property in the dashboard's json_metadata object that contains all native filters had changed name to native_filter_configuration.

This PR migrates all existing dashboards that include native filter configurations from using the now deprecated filter_configuration to the new native_filter_configuration. Dashboards that were already using the new name are unaffected. The migration also limits the migration to dashboards that have native filter configurations, making this migration fairly light weight (won't touch any rows if the native filters feature was not activated).

TEST PLAN

  1. Tested that a dashboard with the old metadata failed to load existing native filters and failed to update metadata
  2. Tested up migration, and made sure it only modified dashboards with the old filter_configuration property to use the new native_filter_configuration property. Also made sure the dashboards loaded the filter configurations correctly, and were able to to save updated metadata.
  3. Tested down migration, and made sure it changed the dashboards to use the old filter_configuration property. Also reran the up migration, and made sure dashboards with native filters were working again.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

@codecov
Copy link

codecov bot commented Mar 24, 2021

Codecov Report

Merging #13769 (2b59f2d) into master (fd7c9eb) will decrease coverage by 0.07%.
The diff coverage is n/a.

❗ Current head 2b59f2d differs from pull request most recent head 1e0d114. Consider uploading reports for the commit 1e0d114 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13769      +/-   ##
==========================================
- Coverage   77.39%   77.32%   -0.08%     
==========================================
  Files         933      933              
  Lines       47186    47186              
  Branches     5872     5872              
==========================================
- Hits        36521    36486      -35     
- Misses      10523    10558      +35     
  Partials      142      142              
Flag Coverage Δ
cypress 56.23% <ø> (ø)
hive ?
mysql 80.56% <ø> (ø)
postgres 80.59% <ø> (ø)
presto 80.25% <ø> (?)
python 80.83% <ø> (-0.14%) ⬇️
sqlite 80.15% <ø> (ø)

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

Impacted Files Coverage Δ
superset/db_engines/hive.py 0.00% <0.00%> (-85.72%) ⬇️
superset/db_engine_specs/hive.py 74.23% <0.00%> (-16.54%) ⬇️
superset/models/core.py 89.37% <0.00%> (+0.27%) ⬆️
superset/connectors/sqla/models.py 90.48% <0.00%> (+0.60%) ⬆️
superset/db_engine_specs/presto.py 88.28% <0.00%> (+5.43%) ⬆️

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 fd7c9eb...1e0d114. Read the comment docs.

Copy link

@junlin-qa junlin-qa left a comment

Choose a reason for hiding this comment

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

oops i approved the wrong PR..
Screen Shot 2021-03-24 at 9 04 18 AM

LGTM

@villebro villebro merged commit 5a50120 into apache:master Mar 24, 2021
@junlincc junlincc added the dashboard:native-filters Related to the native filters of the Dashboard label Mar 25, 2021
allanco91 pushed a commit to allanco91/superset that referenced this pull request May 21, 2021
@john-bodley
Copy link
Member

@villebro I'm not sure if this migration was correct as it seems like the frontend defaults the native_filter_configuration to an empty list whereas you test for falsy and thus when someone views a dashboard the json_metadata will be updated and the viewer will be recorded as the person who last changed it.

cc: @michellethomas

@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.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 dashboard:native-filters Related to the native filters of the Dashboard preset-io size/L 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants