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

feat(native-filters): add support for import/export dashboard #15253

Merged
merged 3 commits into from Jun 19, 2021

Conversation

villebro
Copy link
Member

@villebro villebro commented Jun 18, 2021

SUMMARY

Add support for importing and exporting dashboards containing native filters. The modifications are needed to update the dataset ids that are referenced in the dashboard metadata.

BEFORE

Currently native filter dataset references aren't updated during import (compare with the charts that render correctly):
image

AFTER

Now the native filter dataset references are updated to match those available on the target env:
image

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

  1. export a dashboard
  2. import into a new environment where the datasource ids corresponding to those referenced in the native filter metadata are either missing or have a different id.

TODO:

  • add tests

ADDITIONAL INFORMATION

@zhaoyongjie zhaoyongjie self-requested a review June 18, 2021 12:51
Copy link
Member

@zhaoyongjie zhaoyongjie left a comment

Choose a reason for hiding this comment

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

LGTM, tested in my local environment with 2 Superset instance import / export.

image

@codecov
Copy link

codecov bot commented Jun 18, 2021

Codecov Report

Merging #15253 (6e60b81) into master (745b577) will decrease coverage by 0.25%.
The diff coverage is 51.21%.

❗ Current head 6e60b81 differs from pull request most recent head 89b32f8. Consider uploading reports for the commit 89b32f8 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15253      +/-   ##
==========================================
- Coverage   77.26%   77.00%   -0.26%     
==========================================
  Files         971      971              
  Lines       50308    50346      +38     
  Branches     6140     6140              
==========================================
- Hits        38869    38769     -100     
- Misses      11235    11373     +138     
  Partials      204      204              
Flag Coverage Δ
hive ?
mysql 81.65% <51.21%> (-0.05%) ⬇️
postgres 81.66% <51.21%> (-0.05%) ⬇️
presto ?
python 81.75% <51.21%> (-0.50%) ⬇️
sqlite 81.30% <51.21%> (-0.05%) ⬇️

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

Impacted Files Coverage Δ
superset/models/dashboard.py 75.87% <30.00%> (-2.11%) ⬇️
superset/connectors/connector_registry.py 78.68% <40.00%> (-7.59%) ⬇️
superset/dashboards/commands/importers/v0.py 89.94% <64.70%> (-2.92%) ⬇️
superset/connectors/base/models.py 88.49% <75.00%> (-0.22%) ⬇️
superset/db_engines/hive.py 0.00% <0.00%> (-82.15%) ⬇️
superset/db_engine_specs/hive.py 69.20% <0.00%> (-17.21%) ⬇️
superset/db_engine_specs/presto.py 83.36% <0.00%> (-6.95%) ⬇️
superset/views/database/mixins.py 81.03% <0.00%> (-1.73%) ⬇️
superset/connectors/sqla/models.py 88.15% <0.00%> (-1.66%) ⬇️
superset/db_engine_specs/base.py 87.97% <0.00%> (-0.41%) ⬇️
... and 2 more

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 745b577...89b32f8. Read the comment docs.

@villebro villebro merged commit f24264c into apache:master Jun 19, 2021
@villebro villebro deleted the villebro/nf-import-export branch June 19, 2021 05:29
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
…#15253)

* feat(native-filters): add support for import/export

* fix test and non-dataset filters

* lint
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
…#15253)

* feat(native-filters): add support for import/export

* fix test and non-dataset filters

* lint
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
…#15253)

* feat(native-filters): add support for import/export

* fix test and non-dataset filters

* lint
@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 preset-io size/M 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[import/export][native-filters]import/export is incompatible with Native filters
3 participants