EnxDev commented on code in PR #38343:
URL: https://github.com/apache/superset/pull/38343#discussion_r3356325975


##########
superset/commands/export/assets.py:
##########
@@ -46,20 +48,34 @@ def run(self) -> Iterator[tuple[str, Callable[[], str]]]:
         yield METADATA_FILE_NAME, lambda: yaml.safe_dump(metadata, 
sort_keys=False)
         seen = {METADATA_FILE_NAME}
 
-        commands = [
+        commands: list[type[ExportModelsCommand]] = [
             ExportDatabasesCommand,
             ExportDatasetsCommand,
             ExportChartsCommand,
             ExportDashboardsCommand,
             ExportSavedQueriesCommand,
         ]
 
+        dashboard_ids: list[int | str] = []
+        chart_ids: list[int | str] = []
         for command in commands:
             ids = [model.id for model in command.dao.find_all()]
             for file_name, file_content in command(ids, 
export_related=False).run():
                 if file_name not in seen:
                     yield file_name, file_content
                     seen.add(file_name)
 
+            if command == ExportDashboardsCommand:
+                dashboard_ids = ids
+            elif command == ExportChartsCommand:
+                chart_ids = ids
+
+        # FIXME: It would probably be better to align the tags export
+        # command with the other export commands
+        yield from ExportTagsCommand.export(
+            dashboard_ids=dashboard_ids,
+            chart_ids=chart_ids,
+        )

Review Comment:
   @semohr how about this? 



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