You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "cezudas (via GitHub)" <gi...@apache.org> on 2026/02/09 15:06:57 UTC

[PR] feat(api): return uuid in POST response for dataset, chart, and dashboard [superset]

cezudas opened a new pull request, #37806:
URL: https://github.com/apache/superset/pull/37806

   ### SUMMARY
   
   The auto-generated uuid was missing from the POST creation response for datasets, charts, and dashboards, making it impossible for API consumers to reference newly created resources by UUID without a subsequent GET request.
   
   The database endpoint already returns uuid in its POST response (via `item["uuid"] = new_model.uuid`). This change brings the other three resource types in line with that precedent by adding `uuid=new_model.uuid` to the `self.response()` call in each endpoint.
   
   This is needed for programmatic workflows such as cross-environment dashboard imports that use `dataset_mapping` and `database_mapping` parameters, which require UUIDs to map resources across instances.
   
   Closes #15456 (Issue is was marked as closed due to inactivity)
   
   
   ### TESTING INSTRUCTIONS
   For each of these following endpoints ensure uuid field exist in the response:
   
   - POST /api/v1/dataset/ -- Create a dataset
   <img width="923" height="567" alt="Screenshot 2026-02-09 at 16 57 44" src="https://github.com/user-attachments/assets/598ba024-c0d2-4b40-b1e9-3bfc627053ca" />
   
   
   - POST /api/v1/chart/ -- Create a chart
   <img width="935" height="615" alt="Screenshot 2026-02-09 at 16 58 05" src="https://github.com/user-attachments/assets/9aecdb74-9a1d-46df-97a1-80bc55f32b58" />
   
   
   - POST /api/v1/dashboard/ -- Create a dashboard
   <img width="914" height="545" alt="Screenshot 2026-02-09 at 16 58 51" src="https://github.com/user-attachments/assets/3659e316-85aa-443e-91e4-00cd838591f9" />
   
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(api): return uuid in POST response for dataset, chart, and dashboard [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #37806:
URL: https://github.com/apache/superset/pull/37806#issuecomment-3872282744

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(api): return uuid in POST response for dataset, chart, and dashboard [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas merged PR #37806:
URL: https://github.com/apache/superset/pull/37806


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(api): return uuid in POST response for dataset, chart, and dashboard [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #37806:
URL: https://github.com/apache/superset/pull/37806#issuecomment-3881088184

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/37806?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `0%` with `3 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 43.48%. Comparing base ([`15b3c96`](https://app.codecov.io/gh/apache/superset/commit/15b3c96f8e97148f63e036038727c9a3ea9e15d3?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`6e76231`](https://app.codecov.io/gh/apache/superset/commit/6e7623157946da175005b055fbfeb4d3681e4268?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 30 commits behind head on master.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/37806?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [superset/charts/api.py](https://app.codecov.io/gh/apache/superset/pull/37806?src=pr&el=tree&filepath=superset%2Fcharts%2Fapi.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvY2hhcnRzL2FwaS5weQ==) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/37806?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [superset/dashboards/api.py](https://app.codecov.io/gh/apache/superset/pull/37806?src=pr&el=tree&filepath=superset%2Fdashboards%2Fapi.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9hcGkucHk=) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/37806?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [superset/datasets/api.py](https://app.codecov.io/gh/apache/superset/pull/37806?src=pr&el=tree&filepath=superset%2Fdatasets%2Fapi.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvZGF0YXNldHMvYXBpLnB5) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/37806?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #37806       +/-   ##
   ===========================================
   + Coverage        0   43.48%   +43.48%     
   ===========================================
     Files           0      647      +647     
     Lines           0    49579    +49579     
     Branches        0     5577     +5577     
   ===========================================
   + Hits            0    21560    +21560     
   - Misses          0    27719    +27719     
   - Partials        0      300      +300     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/37806/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [hive](https://app.codecov.io/gh/apache/superset/pull/37806/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `41.72% <0.00%> (?)` | |
   | [presto](https://app.codecov.io/gh/apache/superset/pull/37806/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `41.74% <0.00%> (?)` | |
   | [python](https://app.codecov.io/gh/apache/superset/pull/37806/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `43.48% <0.00%> (?)` | |
   | [unit](https://app.codecov.io/gh/apache/superset/pull/37806/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `100.00% <ø> (?)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/superset/pull/37806?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(api): return uuid in POST response for dataset, chart, and dashboard [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #37806:
URL: https://github.com/apache/superset/pull/37806#issuecomment-4699858255

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
   
   <details>
   <summary>
   Bito Usage Guide
   </summary>
   
   **Commands**
         
   Type the following command in the pull request comment and save the comment.
         
   - `/review` - Manually triggers a full AI review.
   
   - `/pause` - Pauses automatic reviews on this pull request.
   - `/resume` - Resumes automatic reviews.
   - `/resolve` - Marks all Bito-posted review comments as resolved.
   - `/abort` - Cancels all in-progress reviews.
   
         
   Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   
   </details>
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(api): return uuid in POST response for dataset, chart, and dashboard [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #37806:
URL: https://github.com/apache/superset/pull/37806#issuecomment-3872833415

   <div>
   <h3>Code Review Agent Run #ac2c4f</h3>
   
   <div>
   <details>
   <summary>
   <b>Actionable Suggestions -  0</b>
   </summary>
   
   </details>
   </div>
   
   
   
   
   
   
   
   <div>
   <details>
   <summary>
   <b>Review Details</b>
   </summary>
   
   <ul>
   <li>
   <div id="file_reviewed">
   Files reviewed - <b>6</b> · Commit Range: <code>6e76231..6e76231</code>
   <ul>
   <li>superset/charts/api.py</li><li>superset/dashboards/api.py</li><li>superset/datasets/api.py</li><li>tests/integration_tests/charts/api_tests.py</li><li>tests/integration_tests/dashboards/api_tests.py</li><li>tests/integration_tests/datasets/api_tests.py</li>
   </ul>
   </div>
   </li>
   
   <li>
   <div id="file_skipped">
   Files skipped - <b>0</b>
   <ul>
         
   </ul>
   </div>
   </li>
   
   
   <li>
   <div id="tools">
   Tools
   <ul>
         <li><b>Whispers</b> (Secret Scanner) - ✔︎ Successful</li><li><b>Detect-secrets</b> (Secret Scanner) - ✔︎ Successful</li><li><b>MyPy</b> (Static Code Analysis) - ✔︎ Successful</li><li><b>Astral Ruff</b> (Static Code Analysis) - ✔︎ Successful</li>
   </ul>
   </div>
   </li>
   
   </ul>
   </details>
   </div>
   
   <hr>
   
   
   <details>
   <summary>
   <b>Bito Usage Guide</b>
   </summary>
         
   **Commands**
         
   Type the following command in the pull request comment and save the comment.
         
   - `/review` - Manually triggers a full AI review.
   
   - `/pause` - Pauses automatic reviews on this pull request.
   - `/resume` - Resumes automatic reviews.
   - `/resolve` - Marks all Bito-posted review comments as resolved.
   - `/abort` - Cancels all in-progress reviews.
   
         
   Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   </details>
   
   
   
   
   <span><i>AI Code Review powered by</i> <sub><sub><a href="https://bito.ai/" target="_blank"><img src="https://bito.ai/wp-content/uploads/2023/10/Logo-Bito-Black-cropped.svg" alt="Bito Logo" width="50" height="20" /></a></sub></sub></span>
   
   
   </div>


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(api): return uuid in POST response for dataset, chart, and dashboard [superset]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #37806:
URL: https://github.com/apache/superset/pull/37806#discussion_r2790587425


##########
superset/datasets/api.py:
##########
@@ -363,7 +363,7 @@ 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, result=item, data=new_model.data, uuid=new_model.uuid)

Review Comment:
   This `self.response(...)` call exceeds typical line-length/Black formatting used in the repo. Reformat this call onto multiple lines (with trailing commas) so it stays Black-compliant and avoids CI formatting failures.
   ```suggestion
               return self.response(
                   201,
                   id=new_model.id,
                   result=item,
                   data=new_model.data,
                   uuid=new_model.uuid,
               )
   ```



##########
superset/datasets/api.py:
##########
@@ -363,7 +363,7 @@ 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, result=item, data=new_model.data, uuid=new_model.uuid)

Review Comment:
   This POST now includes `uuid` in the 201 response payload, but the OpenAPI docstring still only documents `id` and `result` under `responses: 201`. Please add `uuid` to the documented response schema so the generated API docs match behavior.



##########
superset/charts/api.py:
##########
@@ -362,7 +362,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:
   The POST endpoint now includes a top-level `uuid` in the 201 response, but the OpenAPI docstring for this endpoint still documents only `id` and `result` under `responses: 201`. Please update the response schema docs to include the `uuid` field so generated API docs match the actual payload.



##########
superset/dashboards/api.py:
##########
@@ -702,7 +702,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:
   The POST endpoint now returns a top-level `uuid` in the 201 response, but the OpenAPI docstring for this route still lists only `id` and `result` in the 201 schema. Update the documented response properties to include `uuid` to keep the OpenAPI spec accurate.



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(api): return uuid in POST response for dataset, chart, and dashboard [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #37806:
URL: https://github.com/apache/superset/pull/37806#issuecomment-3872753541

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
   
   <details>
   <summary>
   Bito Usage Guide
   </summary>
   
   **Commands**
         
   Type the following command in the pull request comment and save the comment.
         
   - `/review` - Manually triggers a full AI review.
   
   - `/pause` - Pauses automatic reviews on this pull request.
   - `/resume` - Resumes automatic reviews.
   - `/resolve` - Marks all Bito-posted review comments as resolved.
   - `/abort` - Cancels all in-progress reviews.
   
         
   Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   
   </details>
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(api): return uuid in POST response for dataset, chart, and dashboard [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(api): return uuid in POST response for dataset, chart, and dashboard [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #37806:
URL: https://github.com/apache/superset/pull/37806#discussion_r3408417760


##########
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:** The response now includes a new top-level `uuid` field, but the documented 201 response schema for this endpoint still only declares `id` and `result`. This creates an API contract mismatch for OpenAPI-based clients and validators, so update the OpenAPI response properties to include `uuid` (type `string`, format `uuid`) to keep runtime behavior and spec in sync. [api mismatch]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ⚠️ Dashboard create uuid missing from OpenAPI response schema.
   - ⚠️ Generated dashboard client types omit uuid field.
   ```
   </details>
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Start Superset with this PR's code deployed.
   
   2. Log in and GET the OpenAPI spec at `api/v1/_openapi` as done in
   `tests/integration_tests/base_api_tests.py:10-15`.
   
   3. In the returned spec, inspect the
   `paths["/api/v1/dashboard/"]["post"]["responses"]["201"]["content"]["application/json"]["schema"]["properties"]`
   derived from the docstring at `superset/dashboards/api.py:744-749`, which only documents
   `id` and `result`.
   
   4. Create a dashboard via `POST /api/v1/dashboard/` handled by `DashboardRestApi.post` at
   `superset/dashboards/api.py:718-758` and observe the JSON response includes a top-level
   `uuid` field from line 757, which is not present in the OpenAPI schema, causing contract
   divergence for spec-driven clients.
   ```
   </details>
   
   [Fix in Cursor](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=76bc03dbcf74436cad5a695203ed3d3f&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=76bc03dbcf74436cad5a695203ed3d3f&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:**
   	*Api Mismatch: The response now includes a new top-level `uuid` field, but the documented 201 response schema for this endpoint still only declares `id` and `result`. This creates an API contract mismatch for OpenAPI-based clients and validators, so update the OpenAPI response properties to include `uuid` (type `string`, format `uuid`) to keep runtime behavior and spec in sync.
   
   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=64081e20cf9cc47524ee0b0f2b0e63a8a5bb11b6f6b924b0a55dcf8ef5416b9d&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F37806&comment_hash=64081e20cf9cc47524ee0b0f2b0e63a8a5bb11b6f6b924b0a55dcf8ef5416b9d&reaction=dislike'>👎</a>



##########
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,
+                result=item,
+                data=new_model.data,
+                uuid=new_model.uuid,
+            )

Review Comment:
   **Suggestion:** The POST handler now returns a top-level `uuid`, but the 201 response schema in the same endpoint still documents only `id` and `result`, so spec-driven consumers will not see the new field in their generated types/contracts. Add `uuid` to the documented response schema to prevent runtime/spec divergence. [api mismatch]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ⚠️ Dataset create uuid absent from OpenAPI response schema.
   - ⚠️ Generated dataset client models lack uuid property.
   ```
   </details>
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Start Superset with this PR's code deployed.
   
   2. Log in and GET the OpenAPI spec at `api/v1/_openapi` as shown in
   `tests/integration_tests/base_api_tests.py:10-15`.
   
   3. In the spec, inspect
   `paths["/api/v1/dataset/"]["post"]["responses"]["201"]["content"]["application/json"]["schema"]["properties"]`
   generated from the docstring at `superset/datasets/api.py:347-351`, which only declares
   `id` and `result`.
   
   4. Create a dataset via `POST /api/v1/dataset/` handled by `DatasetRestApi.post` at
   `superset/datasets/api.py:352-37` and observe the JSON response from lines 360-366
   includes top-level `uuid` (and `data`), which are not documented in the 201 response
   schema, leading to mismatch for OpenAPI-based tooling and generated client contracts.
   ```
   </details>
   
   [Fix in Cursor](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=d4efebc16ef3470c8b1f2e58a2dd4448&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=d4efebc16ef3470c8b1f2e58a2dd4448&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:** 360:366
   **Comment:**
   	*Api Mismatch: The POST handler now returns a top-level `uuid`, but the 201 response schema in the same endpoint still documents only `id` and `result`, so spec-driven consumers will not see the new field in their generated types/contracts. Add `uuid` to the documented response schema to prevent runtime/spec divergence.
   
   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=a17124cdb2602c7b105f6ca452fb094e48d4417f2571cc0f0492c309c7972b21&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F37806&comment_hash=a17124cdb2602c7b105f6ca452fb094e48d4417f2571cc0f0492c309c7972b21&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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org