codeant-ai-for-open-source[bot] commented on code in PR #37806:
URL: https://github.com/apache/superset/pull/37806#discussion_r3408406793
##########
superset/datasets/api.py:
##########
@@ -357,7 +357,13 @@ def post(self) -> Response:
try:
new_model = CreateDatasetCommand(item).run()
- return self.response(201, id=new_model.id, result=item,
data=new_model.data)
+ return self.response(
+ 201,
+ id=new_model.id,
Review Comment:
**Suggestion:** Stop returning the internal integer identifier in this newly
added POST response and keep only the UUID-based public identifier to avoid
exposing internal IDs when UUID support is being introduced. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
The PR is adding UUID support to the POST response (`uuid=new_model.uuid`)
while also returning the internal numeric `id`. This matches the custom rule
about not exposing internal integer IDs when a UUID public identifier is being
introduced or changed, so the suggestion identifies a real violation.
</details>
[Fix in
Cursor](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=8d6a6332d1cb4722939986e186b9b4e9&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
| [Fix in VSCode
Claude](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=8d6a6332d1cb4722939986e186b9b4e9&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/datasets/api.py
**Line:** 362:362
**Comment:**
*Custom Rule: Stop returning the internal integer identifier in this
newly added POST response and keep only the UUID-based public identifier to
avoid exposing internal IDs when UUID support is being introduced.
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%2F37806&comment_hash=c32bf9eb694c9ed2f56cca2084693d71f2054762a612049e3413cacbc7ba8b6e&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F37806&comment_hash=c32bf9eb694c9ed2f56cca2084693d71f2054762a612049e3413cacbc7ba8b6e&reaction=dislike'>👎</a>
##########
superset/charts/api.py:
##########
@@ -365,7 +365,7 @@ def post(self) -> Response:
return self.response_400(message=error.messages)
try:
new_model = CreateChartCommand(item).run()
- return self.response(201, id=new_model.id, result=item)
+ return self.response(201, id=new_model.id, result=item,
uuid=new_model.uuid)
Review Comment:
**Suggestion:** Remove the internal integer identifier from the create
response now that a UUID identifier is being added, so the endpoint exposes
only the UUID-based public identifier. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
The response still exposes `id=new_model.id` alongside
`uuid=new_model.uuid`. Under the stated rule, once a UUID public identifier is
being added or changed, newly exposed internal integer IDs should not be
returned in the public API response. This is a real rule violation in the
existing code.
</details>
[Fix in
Cursor](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=ed6f165fb201489da8c3296ccf34977b&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
| [Fix in VSCode
Claude](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=ed6f165fb201489da8c3296ccf34977b&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/charts/api.py
**Line:** 368:368
**Comment:**
*Custom Rule: Remove the internal integer identifier from the create
response now that a UUID identifier is being added, so the endpoint exposes
only the UUID-based public identifier.
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%2F37806&comment_hash=0c347bcc0f6ebb8da054763014329024c6a64c151de323cd229f843b62f7cbf6&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F37806&comment_hash=0c347bcc0f6ebb8da054763014329024c6a64c151de323cd229f843b62f7cbf6&reaction=dislike'>👎</a>
##########
superset/dashboards/api.py:
##########
@@ -754,7 +754,7 @@ def post(self) -> Response:
return self.response_400(message=error.messages)
try:
new_model = CreateDashboardCommand(item).run()
- return self.response(201, id=new_model.id, result=item)
+ return self.response(201, id=new_model.id, result=item,
uuid=new_model.uuid)
Review Comment:
**Suggestion:** Stop returning the internal auto-increment integer
identifier in this create response, and return only the UUID-based public
identifier (plus the existing non-identifier payload fields). [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
The create response exposes both the internal auto-incrementing integer `id`
and the UUID. That matches the custom rule about not exposing internal integer
IDs when a UUID public identifier is being introduced or changed.
</details>
[Fix in
Cursor](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=9a947795f5cd4617b309cea25514ce22&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
| [Fix in VSCode
Claude](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=9a947795f5cd4617b309cea25514ce22&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/dashboards/api.py
**Line:** 757:757
**Comment:**
*Custom Rule: Stop returning the internal auto-increment integer
identifier in this create response, and return only the UUID-based public
identifier (plus the existing non-identifier payload fields).
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%2F37806&comment_hash=22867421de92940b2db00f7c12ea3575a0711f0de47957c45b033dcf8561a01c&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F37806&comment_hash=22867421de92940b2db00f7c12ea3575a0711f0de47957c45b033dcf8561a01c&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]