sadpandajoe commented on code in PR #44347:
URL: https://github.com/apache/superset/pull/44347#discussion_r4302971075
##########
superset/commands/chart/export.py:
##########
@@ -88,8 +111,8 @@ def _file_content(model: Slice) -> str:
if model.datasource_type == "semantic_view":
if model.semantic_view:
payload["datasource_ref"] =
export_view_reference(model.semantic_view)
- elif model.table:
- payload["dataset_uuid"] = str(model.table.uuid)
+ elif dataset := find_chart_dataset(model):
Review Comment:
`ExportAssetsCommand` runs the chart and dashboard exporters with
`export_related=False` and builds its dataset list from the visibility-filtered
`find_all()`, so a trashed dataset's file is never added to that bundle. With
this change the chart YAML now still gets `dataset_uuid` for that dataset (and
the dashboard's native filters get a `datasetUuid`). On re-import via
`ImportAssetsCommand`, `dataset_info[config["dataset_uuid"]]`
(`superset/commands/importers/v1/assets.py:185`) then raises a `KeyError` for
the missing dataset, where before the bundle was rejected with a clear schema
error. Should the full-assets export also include trashed datasets referenced
by the exported charts and filters, or should `dataset_uuid` only be written
when the dataset file travels with the bundle?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]