bito-code-review[bot] commented on code in PR #43232:
URL: https://github.com/apache/superset/pull/43232#discussion_r4164541585


##########
superset/commands/chart/export.py:
##########
@@ -100,28 +190,53 @@ def enable_tag_export(cls) -> None:
     def run(
         self, seen: set[str] | None = None
     ) -> Iterator[tuple[str, Callable[[], str]]]:
+        is_root = seen is None
         yield from super().run(seen=seen)
+        if not self.export_related:
+            return
+
+        chart_ids = 
ExportChartsCommand.chart_ids_with_annotation_sources(self._models)

Review Comment:
   <!-- Bito Reply -->
   The suggestion to gate the computation of 
`chart_ids_with_annotation_sources` is correct and appropriate. By moving this 
computation after the `if not is_root and not export_tags:` check, the code 
avoids unnecessary processing for nested exports (such as those triggered by 
dashboard exports) that do not require the result, thereby improving 
performance.
   
   **superset/commands/chart/export.py**
   ```
   # Nested exports (a dashboard's charts) write neither file, so skip the
           # annotation source walk for them.
           if not is_root and not export_tags:
               return
   
           chart_ids = 
ExportChartsCommand.chart_ids_with_annotation_sources(self._models)
   ```



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