codeant-ai-for-open-source[bot] commented on code in PR #41998:
URL: https://github.com/apache/superset/pull/41998#discussion_r3585996357


##########
superset/migrations/versions/2026-06-30_00-00_d24e6b0a9c7f_strip_metricsqlexpressions_from_ag_grid_params.py:
##########
@@ -33,7 +33,7 @@
 
 from alembic import op
 from sqlalchemy import Column, Integer, String, Text
-from sqlalchemy.ext.declarative import declarative_base
+from sqlalchemy.orm import declarative_base

Review Comment:
   **Suggestion:** Avoid introducing new raw SQLAlchemy migration patterns here 
and refactor this migration to use `superset.migrations.shared.utils` helpers 
for cross-dialect-safe data updates instead of adding ORM-base plumbing 
directly. [custom_rule]
   
   **Severity Level:** Major ⚠️
   <details>
   <summary><b>Why it matters? ⭐ </b></summary>
   
   This migration introduces direct SQLAlchemy ORM plumbing 
(`declarative_base`) instead of using helpers from 
`superset.migrations.shared.utils`, and the repository already provides 
migration helpers such as `paginated_update` for this pattern. That matches the 
migration-specific custom rule violation.
   </details>
   <details>
   <summary><b>Rule source 📖 </b></summary>
   
   .github/copilot-instructions.md (line 294)
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=79d66ccfb573459f95c40d61f8b6d209&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=79d66ccfb573459f95c40d61f8b6d209&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-30_00-00_d24e6b0a9c7f_strip_metricsqlexpressions_from_ag_grid_params.py
   **Line:** 36:36
   **Comment:**
        *Custom Rule: Avoid introducing new raw SQLAlchemy migration patterns 
here and refactor this migration to use `superset.migrations.shared.utils` 
helpers for cross-dialect-safe data updates instead of adding ORM-base plumbing 
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%2F41998&comment_hash=38bc363852468149acf79bed5e3bd45d5ad81fa2f62724a4e43566be121289ea&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41998&comment_hash=38bc363852468149acf79bed5e3bd45d5ad81fa2f62724a4e43566be121289ea&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]

Reply via email to