You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "justinpark (via GitHub)" <gi...@apache.org> on 2024/07/10 21:55:06 UTC

[PR] fix(dataset): Obscure error message on creation [superset]

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

   ### SUMMARY
   Following up #25669 
   This commit adds the SupersetSecurityException case that displays the error message from the statement validation error.
   (When a SupersetSecurityException error is thrown while creating a dataset, it only shows "Fater Error" error message.)
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Before:
   <img width="806" alt="Screenshot 2023-10-16 at 4 32 05 PM" src="https://github.com/apache/superset/assets/1392866/09a8f225-02c8-450e-9b08-0425d86520e1">
   
   After:
   <img width="829" alt="Screenshot 2023-10-16 at 4 41 52 PM" src="https://github.com/apache/superset/assets/1392866/90386841-f966-4969-928d-1c575c16957b">
   
   ### TESTING INSTRUCTIONS
   Go to SQL Lab and create an invalid select statement (`(SELECT 1)` with parentheses)
   Create a dataset and see the error message
   
   ### 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] fix(dataset): Obscure error message on creation [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #29554:
URL: https://github.com/apache/superset/pull/29554#issuecomment-2803123114

   @justinpark do you still intend to merge this one?


-- 
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] fix(dataset): Obscure error message on creation [superset]

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

   ### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
   
   
   |  Name | Link |
   |:-:|------------------------|
   |<span aria-hidden="true">🔨</span> Latest commit | 35337fcaded627986ed5d6dd35fb96c6924b6710 |
   |<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6a3b319289877c0008b54218 |
   |<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-29554--superset-docs-preview.netlify.app](https://deploy-preview-29554--superset-docs-preview.netlify.app) |
   |<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />![QR Code](https://app.netlify.com/qr-code/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTI5NTU0LS1zdXBlcnNldC1kb2NzLXByZXZpZXcubmV0bGlmeS5hcHAifQ.1m7RB_p_hYxttuNK-Qr9yapIdNoLpP4lKPXbP2OtlO8)<br /><br />_Use your smartphone camera to open QR code link._</details> |
   |<span aria-hidden="true">🤖</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#DctRDoMgDADQu_R7TUCnojfwGAXqZjIpKSzZYry7_L2fd0JWOXKFBeABXimFd_O2_xDFl_BVRmRVUTy4FHoxSsJIlQpXDMpUd0mtRs4f-a-x5ZF639u5c7ObpmCMcX54dtbBdQM) |
   ---
   <!-- [superset-docs-preview Preview](https://deploy-preview-29554--superset-docs-preview.netlify.app) -->
   _To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._


-- 
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] fix(dataset): Obscure error message on creation [superset]

Posted by "justinpark (via GitHub)" <gi...@apache.org>.
justinpark closed pull request #29554: fix(dataset): Obscure error message on creation
URL: https://github.com/apache/superset/pull/29554


-- 
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] fix(dataset): Obscure error message on creation [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 #29554:
URL: https://github.com/apache/superset/pull/29554#discussion_r3463980545


##########
superset/commands/dataset/exceptions.py:
##########
@@ -162,11 +165,21 @@ class DatasetInvalidError(CommandInvalidError):
     message = _("Dataset parameters are invalid.")
 
 
-class DatasetCreateFailedError(CreateFailedError):
+class DatasetSQLStatementErrorMixin(CommandException):
+    def __init__(
+        self,
+        ex: Optional[Exception] = None,
+    ) -> None:
+        if isinstance(ex, SupersetSecurityException):
+            self.message = str(ex)
+        super().__init__()
+
+
+class DatasetCreateFailedError(CreateFailedError, DatasetSQLStatementErrorMixin):

Review Comment:
   **Suggestion:** Add a short class docstring to describe the purpose of this newly added exception type. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   This is a newly added Python class and it does not have a docstring in the final file state. That violates the rule requiring new classes to be documented inline.
   </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=f5cd0ad72fcb4b6cbc3c3086d7aa59a7&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=f5cd0ad72fcb4b6cbc3c3086d7aa59a7&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/commands/dataset/exceptions.py
   **Line:** 178:178
   **Comment:**
   	*Custom Rule: Add a short class docstring to describe the purpose of this newly added exception type.
   
   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%2F29554&comment_hash=51a68d2a0f7357d12395d168a9f1a4f6d9dd39a7eaf78cdb20ed6de8cfea14d1&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F29554&comment_hash=51a68d2a0f7357d12395d168a9f1a4f6d9dd39a7eaf78cdb20ed6de8cfea14d1&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] fix(dataset): Obscure error message on creation [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #29554:
URL: https://github.com/apache/superset/pull/29554#issuecomment-3643687130

   Hi @justinpark\! Just following up on this one too - still on your radar? Let us know if you'd like to move forward with it or if we should close it out.


-- 
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] fix(dataset): Obscure error message on creation [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #29554:
URL: https://github.com/apache/superset/pull/29554#issuecomment-4784973762

   Dug into the red CI here @justinpark — the `raise reraise(ex)` change in `on_error` (decorators.py) is the culprit. It now feeds the original exception into every reraise constructor, so `test_delete_dataset_column_fail` comes back with `'()'` instead of `Dataset column delete failed.`. Worth scoping that to just the `SupersetSecurityException` path rather than changing the contract for all transaction-wrapped errors. I'll see if I can help here...


-- 
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] fix(dataset): Obscure error message on creation [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 #29554:
URL: https://github.com/apache/superset/pull/29554#discussion_r3450014429


##########
superset/commands/dataset/exceptions.py:
##########
@@ -162,11 +165,21 @@ class DatasetInvalidError(CommandInvalidError):
     message = _("Dataset parameters are invalid.")
 
 
-class DatasetCreateFailedError(CreateFailedError):
+class DatasetSQLStatementErrorMixin(CommandException):

Review Comment:
   **Suggestion:** Add a class docstring to describe the purpose and behavior of this newly introduced exception mixin. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   This is a newly introduced class and it does not include a docstring. The custom rule requires new Python classes to be documented inline, so the suggestion identifies a real violation.
   </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=e52aa520a44346c69e45328f9954cb4f&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=e52aa520a44346c69e45328f9954cb4f&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/commands/dataset/exceptions.py
   **Line:** 168:168
   **Comment:**
   	*Custom Rule: Add a class docstring to describe the purpose and behavior of this newly introduced exception mixin.
   
   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%2F29554&comment_hash=3d46156aebf092afcdb1dcd635ed98411ce0b3a23d0670b68a8c960afad57926&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F29554&comment_hash=3d46156aebf092afcdb1dcd635ed98411ce0b3a23d0670b68a8c960afad57926&reaction=dislike'>👎</a>



##########
superset/commands/dataset/exceptions.py:
##########
@@ -162,11 +165,21 @@ class DatasetInvalidError(CommandInvalidError):
     message = _("Dataset parameters are invalid.")
 
 
-class DatasetCreateFailedError(CreateFailedError):
+class DatasetSQLStatementErrorMixin(CommandException):
+    def __init__(
+        self,
+        ex: Optional[Exception] = None,
+    ) -> None:
+        if isinstance(ex, SupersetSecurityException):
+            self.message = str(ex)
+        super().__init__()

Review Comment:
   **Suggestion:** Add a method docstring to this new initializer to explain how the optional exception is handled and when the message is overridden. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   This newly added __init__ method has no docstring, and the rule requires newly added Python functions to include docstrings. The suggestion matches a real violation.
   </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=34f8e30ade3644a38a93ea322abd64eb&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=34f8e30ade3644a38a93ea322abd64eb&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/commands/dataset/exceptions.py
   **Line:** 169:175
   **Comment:**
   	*Custom Rule: Add a method docstring to this new initializer to explain how the optional exception is handled and when the message is overridden.
   
   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%2F29554&comment_hash=4e7e30f06f7f628448665a283d4f0ff749ecc2bb6baadf8800ab816e4c81814d&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F29554&comment_hash=4e7e30f06f7f628448665a283d4f0ff749ecc2bb6baadf8800ab816e4c81814d&reaction=dislike'>👎</a>



##########
tests/integration_tests/datasets/api_tests.py:
##########
@@ -887,6 +887,28 @@ def test_create_dataset_with_currency_code_column(self):
         assert model.currency_code_column == "currency"
         self.items_to_delete = [model]
 
+    @pytest.mark.usefixtures("load_energy_table_with_slice")
+    def test_create_dataset_with_sql_validate_select_sql(self):

Review Comment:
   **Suggestion:** Add full type hints to the new test method signature, including an explicit return type, to satisfy the requirement that new Python code is fully typed. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   This is a newly added Python test method in changed code, and it has no type annotations for
   the parameter or the return value. The rule requires new Python code to be fully typed, so
   this is a real violation.
   </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=e4259123cd5e4b099621110146589c5d&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=e4259123cd5e4b099621110146589c5d&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:** tests/integration_tests/datasets/api_tests.py
   **Line:** 891:891
   **Comment:**
   	*Custom Rule: Add full type hints to the new test method signature, including an explicit return type, to satisfy the requirement that new Python code is fully typed.
   
   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%2F29554&comment_hash=6fda76499706859cb7f6f410ef6f1e4a3c18e41ef6eacff79bd337890edd1085&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F29554&comment_hash=6fda76499706859cb7f6f410ef6f1e4a3c18e41ef6eacff79bd337890edd1085&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] fix(dataset): Obscure error message on creation [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 #29554:
URL: https://github.com/apache/superset/pull/29554#discussion_r3450044549


##########
superset/utils/decorators.py:
##########
@@ -227,7 +227,7 @@ def on_error(
             logger.exception(ex.exception)
 
         if reraise:
-            raise reraise() from ex
+            raise reraise(ex) from ex

Review Comment:
   **Suggestion:** Passing the caught exception into `reraise(...)` changes the constructor contract for every transaction-wrapped command error and overrides their curated user-facing messages with raw backend exception text. This can leak internal SQL/database details in API responses and break existing error semantics; instantiate the target exception without using the caught exception as the positional message (or pass it via a dedicated `exception` kwarg only where supported). [security]
   
   <details>
   <summary><b>Severity Level:</b> Critical 🚨</summary>
   
   ```mdx
   - ❌ Dashboard create API leaks raw database error details.
   - ⚠️ Other transaction-wrapped commands expose backend exception messages.
   - ⚠️ Breaks curated CommandException messages in API responses.
   ```
   </details>
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Trigger dashboard creation via HTTP `POST /api/v1/dashboard/`, which is implemented by
   `DashboardRestApi.post` in `superset/dashboards/api.py` around line 721 (see `def
   post(self) -> Response` in the snippet starting at file line 711).
   
   2. In `DashboardRestApi.post`, after schema validation, the code calls
   `CreateDashboardCommand(item).run()` at `superset/dashboards/api.py:749-751`, delegating
   the actual creation logic to the command layer.
   
   3. `CreateDashboardCommand.run` in `superset/commands/dashboard/create.py` (snippet
   starting at file line 35, with the `@transaction(on_error=partial(on_error,
   reraise=DashboardCreateFailedError))` decorator at approximately line 43) executes
   `DashboardDAO.create(...)`; if this raises a `SQLAlchemyError` (e.g., constraint violation
   or SQL parse error), the `transaction` wrapper in `superset/utils/decorators.py` (lines
   ~235-88) catches the exception and calls the configured `on_error(ex)` callback.
   
   4. The default `on_error` callback in `superset/utils/decorators.py` (snippet starting at
   file line 180, where line 229 is `if reraise:` and line 230 is `raise reraise(ex) from
   ex`) sees that `ex` is a `SQLAlchemyError` and `reraise` is `DashboardCreateFailedError`,
   so it executes `raise DashboardCreateFailedError(ex) from ex`; because
   `DashboardCreateFailedError` ultimately inherits `SupersetException(message: str = "",
   exception: Optional[Exception] = None, ...)`, this positional `ex` is treated as the
   *message* rather than the wrapped exception, overwriting the curated class-level message
   and causing `DashboardRestApi.post`'s `except DashboardCreateFailedError as ex: ... return
   self.response_422(message=str(ex))` (around `superset/dashboards/api.py:764-770`) to
   return the raw database error text (potentially including SQL and engine details) to the
   client instead of the intended generic error string.
   ```
   </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=1be341513db74294b71889ed9664f5f3&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=1be341513db74294b71889ed9664f5f3&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/utils/decorators.py
   **Line:** 229:230
   **Comment:**
   	*Security: Passing the caught exception into `reraise(...)` changes the constructor contract for every transaction-wrapped command error and overrides their curated user-facing messages with raw backend exception text. This can leak internal SQL/database details in API responses and break existing error semantics; instantiate the target exception without using the caught exception as the positional message (or pass it via a dedicated `exception` kwarg only where supported).
   
   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%2F29554&comment_hash=647bed19df08c6c5dd063b98dfbc2ed19f3a2fb7e25fdcb14921ba04b46bdc3a&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F29554&comment_hash=647bed19df08c6c5dd063b98dfbc2ed19f3a2fb7e25fdcb14921ba04b46bdc3a&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] fix(dataset): Obscure error message on creation [superset]

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

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/29554?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.
   > Project coverage is 64.83%. Comparing base [(`76d897e`)](https://app.codecov.io/gh/apache/superset/commit/76d897eaa2f9e137102bc194c2e3109c29d0348f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`bf2467c`)](https://app.codecov.io/gh/apache/superset/commit/bf2467c5401f6c31f74592bc98558511430e2fb4?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 439 commits behind head on master.
   
   | [Files](https://app.codecov.io/gh/apache/superset/pull/29554?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/utils/decorators.py](https://app.codecov.io/gh/apache/superset/pull/29554?src=pr&el=tree&filepath=superset%2Futils%2Fdecorators.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvdXRpbHMvZGVjb3JhdG9ycy5weQ==) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/29554?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   #29554      +/-   ##
   ==========================================
   + Coverage   60.48%   64.83%   +4.34%     
   ==========================================
     Files        1931      524    -1407     
     Lines       76236    37733   -38503     
     Branches     8568        0    -8568     
   ==========================================
   - Hits        46114    24464   -21650     
   + Misses      28017    13269   -14748     
   + Partials     2105        0    -2105     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/29554/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/29554/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `49.11% <66.66%> (-0.05%)` | :arrow_down: |
   | [javascript](https://app.codecov.io/gh/apache/superset/pull/29554/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [presto](https://app.codecov.io/gh/apache/superset/pull/29554/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `53.70% <66.66%> (-0.10%)` | :arrow_down: |
   | [python](https://app.codecov.io/gh/apache/superset/pull/29554/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `64.83% <66.66%> (+1.34%)` | :arrow_up: |
   | [unit](https://app.codecov.io/gh/apache/superset/pull/29554/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `59.68% <66.66%> (+2.05%)` | :arrow_up: |
   
   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/29554?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).
   


-- 
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] fix(dataset): Obscure error message on creation [superset]

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

   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] fix(dataset): Obscure error message on creation [superset]

Posted by "justinpark (via GitHub)" <gi...@apache.org>.
justinpark commented on PR #29554:
URL: https://github.com/apache/superset/pull/29554#issuecomment-4794055334

   The error is no longer occurring due to improvements in sqlglot parsing. I will close this PR for now and open a new one if the issue occurs again.


-- 
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] fix(dataset): Obscure error message on creation [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #29554:
URL: https://github.com/apache/superset/pull/29554#issuecomment-4765063194

   @justinpark pinging one more time — this still looks like a worthwhile fix, but it's gone stale and has conflicts. I'll see if I can rebase it to keep things moving forward here...


-- 
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] fix(dataset): Obscure error message on creation [superset]

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

   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