codeant-ai-for-open-source[bot] commented on code in PR #39469:
URL: https://github.com/apache/superset/pull/39469#discussion_r3608478866
##########
superset/migrations/versions/2026-06-23_03-23_a7d3f1b9c2e4_cleanup_stale_can_import_pvm.py:
##########
@@ -112,9 +112,9 @@ def downgrade() -> None:
session = Session(bind=bind)
do_downgrade(session)
try:
- session.commit()
+ session.commit() # pylint: disable=consider-using-transaction
except SQLAlchemyError as ex:
- session.rollback()
+ session.rollback() # pylint: disable=consider-using-transaction
Review Comment:
**Suggestion:** Update the downgrade transaction handling to use the shared
migration utilities rather than invoking SQLAlchemy session commit/rollback
directly. [custom_rule]
**Severity Level:** Major ⚠️
<details>
<summary><b>Why it matters? ⭐ </b></summary>
The downgrade path also uses direct Session.commit()/rollback() calls in the
migration instead of shared migration helpers, so it matches the same
migration-utils rule violation.
</details>
<details>
<summary><b>Rule source 📖 </b></summary>
.github/copilot-instructions.md (line 294)
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=f98d5fcf573a400e9fb53ba11d21b4b4&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=f98d5fcf573a400e9fb53ba11d21b4b4&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:**
superset/migrations/versions/2026-06-23_03-23_a7d3f1b9c2e4_cleanup_stale_can_import_pvm.py
**Line:** 115:117
**Comment:**
*Custom Rule: Update the downgrade transaction handling to use the
shared migration utilities rather than invoking SQLAlchemy session
commit/rollback directly.
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%2F39469&comment_hash=b9e9daf4c584b698fd2a26860c49dfa2a734b93698ddcb9e724603fcf4b705f8&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39469&comment_hash=b9e9daf4c584b698fd2a26860c49dfa2a734b93698ddcb9e724603fcf4b705f8&reaction=dislike'>👎</a>
##########
superset/migrations/versions/2026-06-23_03-23_a7d3f1b9c2e4_cleanup_stale_can_import_pvm.py:
##########
@@ -101,9 +101,9 @@ def upgrade() -> None:
session = Session(bind=bind)
do_upgrade(session)
try:
- session.commit()
+ session.commit() # pylint: disable=consider-using-transaction
except SQLAlchemyError as ex:
- session.rollback()
+ session.rollback() # pylint: disable=consider-using-transaction
Review Comment:
**Suggestion:** In this migration, replace direct transaction control with
the shared migration utility pattern from `superset.migrations.shared.utils` so
behavior remains consistent across database backends. [custom_rule]
**Severity Level:** Major ⚠️
<details>
<summary><b>Why it matters? ⭐ </b></summary>
This migration performs direct Session.commit()/rollback() calls inside
Alembic migration code instead of using shared migration utilities. That
matches the custom rule for migration files that should rely on helpers when
available.
</details>
<details>
<summary><b>Rule source 📖 </b></summary>
.github/copilot-instructions.md (line 294)
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=e9e0d7fde8334fe7b62cdc6eb2049e71&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=e9e0d7fde8334fe7b62cdc6eb2049e71&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:**
superset/migrations/versions/2026-06-23_03-23_a7d3f1b9c2e4_cleanup_stale_can_import_pvm.py
**Line:** 104:106
**Comment:**
*Custom Rule: In this migration, replace direct transaction control
with the shared migration utility pattern from
`superset.migrations.shared.utils` so behavior remains consistent across
database backends.
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%2F39469&comment_hash=9795aa5ddb181564695c63b12ef26143a64bbdd6a696552d9445189b01dba9a3&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39469&comment_hash=9795aa5ddb181564695c63b12ef26143a64bbdd6a696552d9445189b01dba9a3&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]