rusackas commented on code in PR #37120:
URL: https://github.com/apache/superset/pull/37120#discussion_r3653912192


##########
superset/commands/theme/export.py:
##########
@@ -67,8 +67,12 @@ def _file_content(model: Theme) -> str:
 
     @staticmethod
     def _export(
-        model: Theme, export_related: bool = True
+        model: Theme, export_related: bool = True, seen: set[str] | None = None
     ) -> Iterator[tuple[str, Callable[[], str]]]:
+        # Initialize seen set if not provided (for consistency)
+        if seen is None:
+            seen = set()
+

Review Comment:
   It's not really unused, `seen` has to stay in the signature since `run()` 
calls every subclass's `_export(model, export_related, seen)` the same way. 
This one just doesn't have anything to dedupe against.
   



##########
superset/commands/database/export.py:
##########
@@ -104,8 +104,12 @@ def _file_content(model: Database) -> str:
 
     @staticmethod
     def _export(
-        model: Database, export_related: bool = True
+        model: Database, export_related: bool = True, seen: set[str] | None = 
None
     ) -> Iterator[tuple[str, Callable[[], str]]]:
+        # Initialize seen set if not provided
+        if seen is None:
+            seen = set()

Review Comment:
   Same as the theme one, it's kept for parity with `run()`'s call signature. 
Not using it to skip re-computing an already-seen file is a missed 
micro-optimization at worst, `run()` still dedupes the output either way.
   



##########
superset/commands/dashboard/export.py:
##########
@@ -430,7 +436,10 @@ def _export(
                     if dataset_id is not None:
                         dataset = DatasetDAO.find_by_id(dataset_id)
                         if dataset:
-                            yield from 
ExportDatasetsCommand([dataset_id]).run()
+                            # Pass the shared seen set to the dataset export 
command
+                            yield from ExportDatasetsCommand([dataset_id]).run(
+                                seen=seen
+                            )

Review Comment:
   This loop predates this PR, the diff here only threads `seen` through it. 
I'd rather track a dataset-export authorization pass as its own issue than fold 
it into a cross-database export fix.
   



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