-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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): add support for versioned import/export #16017
Conversation
superset/charts/schemas.py
Outdated
query_context = fields.Dict() | ||
query_context = fields.String() |
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 caused a schema validation exception and needed to be changed to the string type
"datasource_type": "view" if dataset.is_sqllab_view else "table", | ||
"datasource_type": dataset.datasource_type, |
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 also caused an import error, since virtual datasets are in fact regular tables (they just have the sql
property set).
Codecov Report
@@ Coverage Diff @@
## master #16017 +/- ##
==========================================
- Coverage 77.03% 76.80% -0.24%
==========================================
Files 989 990 +1
Lines 52413 52491 +78
Branches 6634 6639 +5
==========================================
- Hits 40378 40317 -61
- Misses 11812 11950 +138
- Partials 223 224 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
309bfe6
to
b9b09ee
Compare
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.
Tested that all the new created dashboard are working fine.(both importing and exporting)
e8d6420
to
78d136e
Compare
…16017) * fix(native-filters): add support for versioned import/export * fix lint * address CR * make query_context nullable
…16017) * fix(native-filters): add support for versioned import/export * fix lint * address CR * make query_context nullable
…16017) * fix(native-filters): add support for versioned import/export * fix lint * address CR * make query_context nullable
…16017) * fix(native-filters): add support for versioned import/export * fix lint * address CR * make query_context nullable
SUMMARY
This PR fixes native filter metadata in versioned import/export of dashboards by doing the following:
datasetId
withdatasetUuid
in native filter targets to ensure that dataset reference is based on UUID, not numeric id.Other bycatch fixes that were found while testing:
query_context
inImportV1ChartSchema
, which should beString
, notDict
(caused a marshmallow schema validation exception). Also make it acceptNone
values and add JSON validation.datasource_type
indataset_info
was set asview
if the table was a virtual table, which caused an exception when importing virtual datasets. Since virtual datasets are in fact regulartable
datasources, we just reference thedatasource_type
of the imported dataset.SCREENSHOT
Now native filter targets are referencing
![image](https://user-images.githubusercontent.com/33317356/127825419-d0e82a8e-19c3-4afa-87c0-77ee4bd2f4ce.png)
datasetUuid
instead ofdatasetId
:TESTING INSTRUCTIONS
datasetUuid
instead ofdatasetId
referencesADDITIONAL INFORMATION