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


##########
superset-frontend/src/features/databases/DatabaseModal/index.tsx:
##########
@@ -787,6 +793,16 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> 
= ({
     ) ||
     {};
 
+  // A saved driver's schema can remain usable even when that driver is no 
longer
+  // installed. Do not replace it with another driver's form for the same 
engine.
+  const dbModel: DatabaseForm =
+    isEditMode && db?.parameters_schema?.properties
+      ? {
+          ...availableDbModel,
+          parameters: db.parameters_schema as DatabaseForm['parameters'],

Review Comment:
   **Suggestion:** For an unconverted `databricks+connector://` connection, 
this saved schema builds a `databricks://` URI; the rebind check sees a 
different driver and rejects the unchanged masked token.
   
   **Assessment:** ๐ŸŸ  `Major` ยท ๐Ÿ” `Occurrence: Rarely` ยท ๐Ÿท๏ธ `Logic error`
   
   [![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)
 [![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=19870b13180c47ca991aa8567da55542&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=19870b13180c47ca991aa8567da55542&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-frontend/src/features/databases/DatabaseModal/index.tsx
   **Line:** 802:802
   **Comment:**
        *Logic Error: For an unconverted `databricks+connector://` connection, 
this saved schema builds a `databricks://` URI; the rebind check sees a 
different driver and rejects the unchanged masked token.
   
   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%2F45843&comment_hash=aaae0f0299255d9d409128389632cfc5c9b3cf8e10ee69f64de756d50aab284d&reaction=like'>๐Ÿ‘</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45843&comment_hash=aaae0f0299255d9d409128389632cfc5c9b3cf8e10ee69f64de756d50aab284d&reaction=dislike'>๐Ÿ‘Ž</a>



##########
superset/commands/database/utils.py:
##########
@@ -58,7 +80,12 @@ def uri_identity_changed(existing_uri: str | None, 
submitted_uri: str | None) ->
         # An unparseable URI cannot be compared: treat it as a change so a
         # stored secret never survives onto it.
         return True
-    return stored != incoming
+    if stored == incoming:
+        return False
+    engine_spec = Database.get_db_engine_spec(stored)
+    return engine_spec.get_connection_identity(
+        stored, _connect_args(existing_extra)
+    ) != engine_spec.get_connection_identity(incoming, 
_connect_args(submitted_extra))

Review Comment:
   **Suggestion:** `databricks+connector` selects the legacy spec, whose 
identity retains the URI scheme; rebuilding the same destination as 
`databricks://` is treated as a change, rejecting or testing with the masked 
token.
   
   **Assessment:** ๐ŸŸ  `Major` ยท ๐Ÿ” `Occurrence: Rarely` ยท ๐Ÿท๏ธ `Incorrect condition 
logic`
   
   [![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)
 [![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=1a071ef5b70b4c37bbe1d71ba8d4ca78&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=1a071ef5b70b4c37bbe1d71ba8d4ca78&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/utils.py
   **Line:** 85:88
   **Comment:**
        *Incorrect Condition Logic: `databricks+connector` selects the legacy 
spec, whose identity retains the URI scheme; rebuilding the same destination as 
`databricks://` is treated as a change, rejecting or testing with the masked 
token.
   
   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%2F45843&comment_hash=fbc51b93956e0ec4e263fda41caa05ee80513f1f8f48104360ebb8e4ba438e44&reaction=like'>๐Ÿ‘</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45843&comment_hash=fbc51b93956e0ec4e263fda41caa05ee80513f1f8f48104360ebb8e4ba438e44&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