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


##########
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:
   <!-- Bito Reply -->
   The suggestion to remove the `seen` parameter initialization is based on the 
assumption that `run()` always provides a `seen` set. Since `_export` is also 
called directly in unit tests without providing this argument, the `None`-check 
is necessary to prevent errors in those test scenarios. Therefore, the current 
implementation is correct and should be maintained.
   
   **superset/commands/database/export.py**
   ```
   @staticmethod
       def _export(
           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()
   ```



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