codeant-ai-for-open-source[bot] commented on code in PR #43586:
URL: https://github.com/apache/superset/pull/43586#discussion_r3870215698
##########
superset/commands/database/uploaders/base.py:
##########
@@ -168,11 +168,14 @@ def run(self) -> None:
)
)
+ catalog = self._model.get_default_catalog()
+
sqla_table = (
db.session.query(SqlaTable)
.filter_by(
table_name=self._table_name,
schema=self._schema,
+ catalog=catalog,
Review Comment:
**Suggestion:** The exact `catalog=catalog` predicate prevents the lookup
from finding legacy active datasets whose `catalog` is `NULL`, even though
`DatasetDAO` treats `NULL` as equivalent to the database's default catalog. The
command then skips the existing-dataset path, making the later catalog backfill
unreachable; the upload may fail because the physical table already exists or
create a duplicate metadata row. Use the DAO's null-aware catalog identity
filter, or otherwise include `catalog IS NULL` when `catalog` equals the
default. [api mismatch]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ❌ Legacy uploaded datasets cannot be repaired during re-upload.
- ❌ Default upload fails when the physical table already exists.
- ⚠️ Existing dataset remains absent from catalog-aware permission matching.
```
</details>
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=48cfce8bab154f4f95be9505c46e4984&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=48cfce8bab154f4f95be9505c46e4984&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset/commands/database/uploaders/base.py
**Line:** 178:178
**Comment:**
*Api Mismatch: The exact `catalog=catalog` predicate prevents the
lookup from finding legacy active datasets whose `catalog` is `NULL`, even
though `DatasetDAO` treats `NULL` as equivalent to the database's default
catalog. The command then skips the existing-dataset path, making the later
catalog backfill unreachable; the upload may fail because the physical table
already exists or create a duplicate metadata row. Use the DAO's null-aware
catalog identity filter, or otherwise include `catalog IS NULL` when `catalog`
equals the default.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43586&comment_hash=cd4e4a15fbfd821eea260ac4e8e379da7605b08dfe9462b1fb0a5491d2dacc78&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43586&comment_hash=cd4e4a15fbfd821eea260ac4e8e379da7605b08dfe9462b1fb0a5491d2dacc78&reaction=dislike'>👎</a>
--
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]