You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "eschutho (via GitHub)" <gi...@apache.org> on 2026/08/22 16:47:16 UTC
[PR] fix(tags): catch TemplateError when validating access for tagged SQL Lab queries [superset]
eschutho opened a new pull request, #43423:
URL: https://github.com/apache/superset/pull/43423
### SUMMARY
When tagging a saved SQL Lab query, `CreateCustomTagCommand._validate_object_access()` calls `security_manager.raise_for_access(query=target_object)`, wrapped only in `except SupersetSecurityException:`.
For a user who lacks blanket database-level access and relies on per-table/dataset permissions, `raise_for_access()` parses the query's Jinja-templated SQL via `superset/sql/parse.py::process_jinja_sql()` (which calls `processor.env.parse(sql)`) to determine referenced tables. As its docstring states, that can raise a raw `jinja2.exceptions.TemplateError` (e.g. `TemplateSyntaxError` on malformed Jinja such as an unclosed `{% if %}` block). Because that exception is not a `SupersetSecurityException`, it escaped the narrow `except` clause and propagated as an unhandled 500 instead of a proper Superset validation error.
**Fix:** widen the `except` clause in `_validate_object_access` to `except (SupersetSecurityException, TemplateError):`, keeping the file's existing append-to-`exceptions`-list convention, and reword the message slightly since a template-render failure isn't strictly an access denial.
### PROBLEM
Tagging a saved SQL Lab query whose SQL contains malformed Jinja returned an unhandled 500 (raw `jinja2.TemplateSyntaxError`) rather than a `TagInvalidError` validation response, for users authorized via per-table/dataset permissions.
### FIX
`superset/commands/tag/create.py`: catch `TemplateError` alongside `SupersetSecurityException` in `CreateCustomTagCommand._validate_object_access`, mapping the template-parse failure into the collected validation exceptions.
### TESTING INSTRUCTIONS
- Added `test_validate_object_access_query_malformed_jinja` in `tests/unit_tests/tags/commands/create_test.py`, which exercises the query path with malformed Jinja SQL (`SELECT * FROM {% if %} broken`) and forces the per-table authorization path (`can_access_database` → `False`), asserting it surfaces as `TagInvalidError`.
- Verified fail-before/pass-after: on the pre-fix code the test fails with the raw `jinja2.exceptions.TemplateSyntaxError` escaping through `process_jinja_sql`; post-fix it passes.
- Full file green: `pytest tests/unit_tests/tags/commands/create_test.py` → 3 passed.
- `ruff check` and `ruff format --check` pass on the changed files.
### ADDITIONAL INFORMATION
This is the same recurring bug class as PRs #42366, #42401, #42757, #42917, #43145, and #43226 — a raw jinja2 `TemplateError` escaping a `raise_for_access()`/SQL-parsing call site instead of being mapped to a Superset exception. `superset/commands/sql_lab/results.py` already establishes the local pattern of catching `TemplateError` alongside `SupersetSecurityException`.
Note: the sibling site `superset/commands/tag/delete.py` has the identical duplicated `_validate_object_access` method with the same bug. It is intentionally left untouched here and will be addressed in a follow-up PR.
- [ ] 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
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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(tags): catch TemplateError when validating access for tagged SQL Lab queries [superset]
Posted by "eschutho (via GitHub)" <gi...@apache.org>.
eschutho merged PR #43423:
URL: https://github.com/apache/superset/pull/43423
--
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(tags): catch TemplateError when validating access for tagged SQL Lab queries [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #43423:
URL: https://github.com/apache/superset/pull/43423#issuecomment-5382397430
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 an incremental AI Review.
- `/review full` - 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(tags): catch TemplateError when validating access for tagged SQL Lab queries [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #43423:
URL: https://github.com/apache/superset/pull/43423#issuecomment-5381520824
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/43423?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 `50.00000%` with `1 line` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 57.36%. Comparing base ([`f2610e9`](https://app.codecov.io/gh/apache/superset/commit/f2610e9dca01cb35e831bb89c3fcd5ef17111482?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`698181e`](https://app.codecov.io/gh/apache/superset/commit/698181e93d6935693d32f78188c5c09f88b409bf?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
| [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/43423?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/commands/tag/create.py](https://app.codecov.io/gh/apache/superset/pull/43423?src=pr&el=tree&filepath=superset%2Fcommands%2Ftag%2Fcreate.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvY29tbWFuZHMvdGFnL2NyZWF0ZS5weQ==) | 50.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/43423?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
> :exclamation: There is a different number of reports uploaded between BASE (f2610e9) and HEAD (698181e). Click for more details.
>
> <details><summary>HEAD has 118 uploads less than BASE</summary>
>
>| Flag | BASE (f2610e9) | HEAD (698181e) |
>|------|------|------|
>|python|103|1|
>|presto|17|1|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #43423 +/- ##
===========================================
- Coverage 78.85% 57.36% -21.49%
===========================================
Files 2876 2876
Lines 164581 164582 +1
Branches 38011 38011
===========================================
- Hits 129786 94420 -35366
- Misses 32348 69268 +36920
+ Partials 2447 894 -1553
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/43423/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/43423/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [mysql](https://app.codecov.io/gh/apache/superset/pull/43423/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [postgres](https://app.codecov.io/gh/apache/superset/pull/43423/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/43423/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `40.01% <50.00%> (+<0.01%)` | :arrow_up: |
| [python](https://app.codecov.io/gh/apache/superset/pull/43423/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `40.01% <50.00%> (-43.54%)` | :arrow_down: |
| [sqlite](https://app.codecov.io/gh/apache/superset/pull/43423/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [unit](https://app.codecov.io/gh/apache/superset/pull/43423/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
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 Harness](https://app.codecov.io/gh/apache/superset/pull/43423?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] fix(tags): catch TemplateError when validating access for tagged SQL Lab queries [superset]
Posted by "aminghadersohi (via GitHub)" <gi...@apache.org>.
aminghadersohi commented on code in PR #43423:
URL: https://github.com/apache/superset/pull/43423#discussion_r3836580451
##########
superset/commands/tag/create.py:
##########
@@ -97,9 +99,14 @@ def _validate_object_access(
f"Access validation not supported for {object_type}"
)
)
- except SupersetSecurityException:
+ except (SupersetSecurityException, TemplateError):
Review Comment:
NIT: this `except` wraps all four `object_type` branches (dashboard/chart/query/dataset), but only the `query` branch can currently raise `TemplateError` (confirmed by reading `raise_for_access` — the dashboard/chart/dataset branches never touch Jinja/`process_jinja_sql`). The comment above implies the fix is scoped to the query case; consider narrowing the except to just the `query` branch so a future unrelated `TemplateError` raised from another branch isn't silently misreported as an access-validation failure for that object type.
##########
superset/commands/tag/create.py:
##########
@@ -97,9 +99,14 @@ def _validate_object_access(
f"Access validation not supported for {object_type}"
)
)
- except SupersetSecurityException:
+ except (SupersetSecurityException, TemplateError):
Review Comment:
No logging when swallowing `TemplateError` here. `SupersetSecurityException` being swallowed silently is intentional (routine, expected auth denial), but `TemplateError` represents a genuinely unexpected condition — previously it propagated as an unhandled 500 with a full traceback visible in server logs/Sentry. Now it's converted to a generic `TagCreateFailedError` with zero `logger.warning`/`logger.exception` call anywhere in this file. A malformed-Jinja saved query (or any other bug that raises `TemplateError` here) becomes invisible server-side. Suggest binding the exception (`except (SupersetSecurityException, TemplateError) as ex:`) and logging `str(ex)` before appending to `exceptions`.
##########
superset/commands/tag/create.py:
##########
@@ -97,9 +99,14 @@ def _validate_object_access(
f"Access validation not supported for {object_type}"
)
)
- except SupersetSecurityException:
+ except (SupersetSecurityException, TemplateError):
Review Comment:
The PR description says this follows the pattern already established in `superset/commands/sql_lab/results.py`, but that file actually uses two separate except arms with materially different handling:
```python
except SupersetSecurityException as ex:
raise SupersetErrorException(SupersetError(message=__("Cannot access the query"), ...), status=403) from ex
except TemplateError as ex:
raise SupersetErrorException(SupersetError(message=str(ex), ...), status=400) from ex
```
It preserves the real Jinja error text (`str(ex)`) and distinguishes security vs. validation failures by status code. This PR instead merges both exception types into one `except (...)` tuple with a single hardcoded generic message, discarding `str(ex)` and the security/validation distinction the referenced pattern was built to keep. Worth at least surfacing `str(ex)` so the actual template error isn't lost.
--
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(tags): catch TemplateError when validating access for tagged SQL Lab queries [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 #43423:
URL: https://github.com/apache/superset/pull/43423#discussion_r3836522547
##########
superset/commands/tag/create.py:
##########
@@ -97,9 +99,14 @@ def _validate_object_access(
f"Access validation not supported for {object_type}"
)
)
- except SupersetSecurityException:
+ except (SupersetSecurityException, TemplateError):
Review Comment:
**Suggestion:** The exception handling still omits `SupersetParseError`, which `process_jinja_sql()` raises when a saved query contains an unresolvable partition macro. That exception escapes `_validate_object_access()` instead of being appended to `exceptions`, so tagging such a query bypasses the command's `TagInvalidError` validation response. Catch `SupersetParseError` here as well and map it into the collected validation errors. [incomplete implementation]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ❌ Tagging affected SQL Lab queries returns an unhandled server error.
- ⚠️ Tag API misses its expected validation response.
- ⚠️ Queries using dynamic partition macros cannot be tagged reliably.
```
</details>
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset/commands/tag/create.py
**Line:** 102:102
**Comment:**
*Incomplete Implementation: The exception handling still omits `SupersetParseError`, which `process_jinja_sql()` raises when a saved query contains an unresolvable partition macro. That exception escapes `_validate_object_access()` instead of being appended to `exceptions`, so tagging such a query bypasses the command's `TagInvalidError` validation response. Catch `SupersetParseError` here as well and map it into the collected validation errors.
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%2F43423&comment_hash=57442ba1d874708121e7940e9d03e1d73eb7b6071963000ad01cda568d0318be&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43423&comment_hash=57442ba1d874708121e7940e9d03e1d73eb7b6071963000ad01cda568d0318be&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(tags): catch TemplateError when validating access for tagged SQL Lab queries [superset]
Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #43423:
URL: https://github.com/apache/superset/pull/43423#issuecomment-5403788612
### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | 1309b41da2b46a80f1b430028563aca4c5166c20 |
|<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6a8cee511d0819000866433c |
|<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-43423--superset-docs-preview.netlify.app](https://deploy-preview-43423--superset-docs-preview.netlify.app) |
|<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br /><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#DYtbCoAgEADvst8JiiXWDTrGtm4P0JTNjyK6e_7NwMwLRXIqFSaADhbBk_bG63GryqlErMwiWVTFTZFwc4VEfF0tD1xifubQBoeemAdjgvZm1Fp753prCb4f) |
---
<!-- [superset-docs-preview Preview](https://deploy-preview-43423--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(tags): catch TemplateError when validating access for tagged SQL Lab queries [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #43423:
URL: https://github.com/apache/superset/pull/43423#issuecomment-5381501966
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] fix(tags): catch TemplateError when validating access for tagged SQL Lab queries [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #43423:
URL: https://github.com/apache/superset/pull/43423#issuecomment-5405168490
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 an incremental AI Review.
- `/review full` - 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(tags): catch TemplateError when validating access for tagged SQL Lab queries [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #43423:
URL: https://github.com/apache/superset/pull/43423#issuecomment-5381527264
<!-- Bito Reply -->
The flagged issue is correct. The current implementation in the PR catches `TemplateError` but misses `SupersetParseError`, which is specifically raised by `process_jinja_sql()` when partition macros cannot be resolved. To resolve this, you should update the exception handling in `superset/commands/tag/create.py` to include `SupersetParseError` in the `except` block.
Here is the corrected implementation:
```python
from superset.exceptions import SupersetParseError
# ...
except (SupersetSecurityException, TemplateError, SupersetParseError):
exceptions.append(
TagCreateFailedError(
f"Could not validate access for {object_type} {object_id}"
)
)
```
I have checked the available PR comments, and there are no other pending review comments to address. Would you like me to proceed with any other changes?
**superset/commands/tag/create.py**
```
except (SupersetSecurityException, TemplateError, SupersetParseError):
exceptions.append(
TagCreateFailedError(
f"Could not validate access for {object_type} {object_id}"
)
)
```
--
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