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


##########
superset/commands/dataset/duplicate.py:
##########
@@ -66,6 +66,7 @@ def run(self) -> Model:
         table = SqlaTable(table_name=table_name, owners=owners)
         table.database = database
         table.schema = self._base_model.schema
+        table.catalog = self._base_model.catalog

Review Comment:
   <!-- Bito Reply -->
   Your change removes the fallback to `database.get_default_catalog()` from 
the validation function, ensuring that both the uniqueness check and the 
catalog assignment in the duplicated dataset use `self._base_model.catalog` 
directly. This maintains consistency by preserving the base model's catalog 
property, aligning with the expectation that duplicates should retain original 
attributes. The fix addresses the inconsistency flagged in the review comments 
without altering the run method.
   
   **superset/commands/dataset/duplicate.py**
   ```
   catalog = self._base_model.catalog
   
           table = Table(duplicate_name, self._base_model.schema, catalog)
   ```
   
   **superset/commands/dataset/duplicate.py**
   ```
   table.catalog = self._base_model.catalog
   ```



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