L4XB commented on code in PR #44347:
URL: https://github.com/apache/superset/pull/44347#discussion_r4303027302


##########
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:
   Good catch, thanks. I went with the first option in 572dece93b. Writing 
`dataset_uuid` only when the dataset file is in the bundle would bring back the 
rejected bundle that #44309 is about.
   
   `ExportAssetsCommand` now collects the datasets in the trash that the 
exported charts (through `find_chart_dataset`) and the dashboards' native 
filters or display controls (through a shared `dashboard_dataset_ids()` helper) 
still name. It exports those with `include_deleted=True` after the regular 
passes. The DAO base filter still applies to every lookup, so this only adds 
datasets the user could read through the chart. A full export also still leaves 
out trashed datasets that nothing references.
   
   The new `test_assets_export_carries_the_soft_deleted_datasets_it_references` 
trashes a chart's dataset and a filter-only dataset. It checks that both are in 
the `ExportAssetsCommand` bundle, and that `ImportAssetsCommand` imports it and 
brings both out of the trash. Without the change, the bundle has neither 
dataset file. The chart, dashboard, dataset, importers, export and importexport 
suites pass (432 + 208), and ruff and mypy are clean on the changed modules.



-- 
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]

Reply via email to