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


##########
superset-frontend/src/SqlLab/components/SqlEditor/index.tsx:
##########
@@ -865,6 +865,7 @@ const SqlEditor: FC<Props> = ({
           }
           saveQueryWarning={saveQueryWarning}
           database={database}
+          canSaveDataset={latestQuery?.state === 'success'}

Review Comment:
   **Suggestion:** The success state belongs to the previous `latestQuery`, and 
editing SQL does not clear or replace `latestQueryId`, so this remains enabled 
after a user changes the SQL following a successful run. The dataset modal then 
receives the newly edited SQL together with columns from the older result. 
Track the SQL associated with the successful query or invalidate dataset saving 
whenever the editor SQL changes. [stale reference]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ❌ Dataset creation can save unexecuted edited SQL.
   - ⚠️ Dataset columns can come from an earlier query result.
   - ⚠️ SQL Lab presents stale success state after edits.
   ```
   </details>
   
   [![Use CodeAnt 
Skill](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/use-codeant-skill-flat-v2.svg)](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/src/SqlLab/components/SqlEditor/index.tsx
   **Line:** 868:868
   **Comment:**
        *Stale Reference: The success state belongs to the previous 
`latestQuery`, and editing SQL does not clear or replace `latestQueryId`, so 
this remains enabled after a user changes the SQL following a successful run. 
The dataset modal then receives the newly edited SQL together with columns from 
the older result. Track the SQL associated with the successful query or 
invalidate dataset saving whenever the editor SQL changes.
   
   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%2F43330&comment_hash=7f6967edb4d2fa21959d217b96f1076e58242dda62c5218f8d460fac28a286bf&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43330&comment_hash=7f6967edb4d2fa21959d217b96f1076e58242dda62c5218f8d460fac28a286bf&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