Repository navigation
feat: export charts as ZIP files - #11349
Conversation
c630729 to
6a4b629
Compare
Codecov Report
@@ Coverage Diff @@
## master #11349 +/- ##
==========================================
+ Coverage 61.65% 65.90% +4.24%
==========================================
Files 839 840 +1
Lines 39966 40035 +69
Branches 3662 3662
==========================================
+ Hits 24643 26385 +1742
+ Misses 15142 13549 -1593
+ Partials 181 101 -80
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
6a4b629 to
a98a35f
Compare
4d3f109 to
8a2c17f
Compare
| @protect() | ||
| @safe | ||
| @statsd_metrics | ||
| @rison(get_export_ids_schema) |
There was a problem hiding this comment.
Rison!! btw thks for creating this: https://github.com/betodealmeida/python-rison
tip: You can register the the rison spec on OpenApi like this: https://github.com/apache/incubator-superset/blob/master/superset/charts/api.py#L169
Then reference it like this: https://github.com/apache/incubator-superset/blob/master/superset/charts/api.py#L393
There was a problem hiding this comment.
Ah, thanks! #TIL!
I register the spec in #11373, I'll update the schemas in that PR.
| @rison(get_export_ids_schema) | ||
| def export(self, **kwargs: Any) -> Response: | ||
| """Export dashboards | ||
| """Export datasets |
There was a problem hiding this comment.
"Let him who has never copied-and-pasted in a rush cast the first stone"
| try: | ||
| payload["params"] = json.loads(payload["params"]) | ||
| except json.decoder.JSONDecodeError: | ||
| pass |
There was a problem hiding this comment.
add logger.warn to know loading the params object failed
a98a35f to
fe07aae
Compare
fe07aae to
3743795
Compare
298498f to
af4ae0a
Compare
* Export datasets as ZIP files * Add logging when failing to parse extra * Export charts as Zip file * Fix lint
NB: We're here discussing the `import-dashboards` CLI with the `VERSIONED_EXPORT` feature flag *turned ON* — cf. apache#11349 Currently, `superset import-dashboards` looks up at the required databases (`export/databases/*.yaml`). If the db URI (`sqlalchemy_uri` key) contains a masked password, then the script looks up for already existing databases record. The match is currently done using db UUID. However, '<insert how UUIDs are generated>', the same db connection (same URI) might not have the same UUID on the export instance, and on the import one. (Cf. apache#16395) Thus, we propose to lookup for the db _name_ instead — this would also allow for updating the db URI between the export and the import instance. Note: this change should not be propagated for the demo db, as its UUID has been frozen in apache#15724. Signed-off-by: Étienne Boisseau-Sierra <[email protected]>
* Export datasets as ZIP files * Add logging when failing to parse extra * Export charts as Zip file * Fix lint
SUMMARY
Add a new endpoint to export charts as a Zip file, following #11167.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TEST PLAN
Added unit tests for
ExportChartsCommandand for the API endpoint.ADDITIONAL INFORMATION