asher-lab commented on code in PR #30833:
URL: https://github.com/apache/superset/pull/30833#discussion_r1852522083


##########
superset/commands/chart/export.py:
##########
@@ -85,3 +102,12 @@ def _export(
 
         if model.table and export_related:
             yield from ExportDatasetsCommand([model.table.id]).run()
+
+        # Check if the calling class is ExportDashboardCommands
+        if (
+            export_related
+            and ExportChartsCommand._include_tags
+            and feature_flag_manager.is_feature_enabled("TAGGING_SYSTEM")
+        ):
+            chart_id = model.id
+            yield from ExportTagsCommand().export(chart_ids=[chart_id])

Review Comment:
   ```
       _include_tags: bool = True  # Default to True
   
       @classmethod
       def disable_tag_export(cls) -> None:
           cls._include_tags = False
   
       @classmethod
       def enable_tag_export(cls) -> None:
           cls._include_tags = True
   ```
   ```
           # Check if the calling class is ExportDashboardCommands
           if (
               export_related
               and ExportChartsCommand._include_tags
               and feature_flag_manager.is_feature_enabled("TAGGING_SYSTEM")
           ):
               chart_id = model.id
               yield from ExportTagsCommand().export(chart_ids=[chart_id])
   ```
   ^^ Tags are included only for charts exports here.
   
   Our dashboard export has its own line of export:
   
   ```
           if export_related:
               chart_ids = [chart.id for chart in model.slices]
               dashboard_ids = model.id
               ExportChartsCommand.disable_tag_export()
               yield from ExportChartsCommand(chart_ids).run()
               ExportChartsCommand.enable_tag_export()
               if feature_flag_manager.is_feature_enabled("TAGGING_SYSTEM"):
                   yield from ExportTagsCommand.export(
                       dashboard_ids=dashboard_ids, chart_ids=chart_ids
                   )
   ```



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