You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "stockarea (via GitHub)" <gi...@apache.org> on 2025/12/11 05:13:50 UTC
[I] View Query Not SHowing. [superset]
stockarea opened a new issue, #36500:
URL: https://github.com/apache/superset/issues/36500
### Bug description
In embedded dashboard, view query is not working.
Its coming empty.
Superset version : 5.0.0-dev
### Screenshots/recordings
<img width="1641" height="878" alt="Image" src="https://github.com/user-attachments/assets/51db9cfd-53d7-4a66-acc7-2182c8d45cf3" />
### Superset version
5.0.0
### Python version
3.9
### Node version
16
### Browser
Chrome
### Additional context
_No response_
### Checklist
- [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
--
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.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: [I] View Query Not SHowing. [superset]
Posted by "uzegonemad (via GitHub)" <gi...@apache.org>.
uzegonemad commented on issue #36500:
URL: https://github.com/apache/superset/issues/36500#issuecomment-4836764481
@rusackas I believe I got to the bottom of this one.
I'm running 6.1 and experiencing the same issue with embedded.
The response I get when I press "View Query" on a chart in an embedded dashboard:
```json
{"result": [{"language": "sql"}, {"language": "sql"}]}
```
Looks like [charts/data/api.py](https://github.com/apache/superset/blob/f2048886c0d1e874e53bc70aed818941011b1897/superset/charts/data/api.py#L449-L451) removes the `query` key for guest users.
Adding a check for `can_view_query` made it work for me.
```python
if security_manager.is_guest_user() and not security_manager.can_access("can_view_query", "Dashboard"):
```
---
I don't think it matters given the above but my guest role has these perms:
- can drill Dashboard
- can get drill info Dashboard
- can read Chart
- can read CurrentUserRestApi
- can read Dashboard
- can read Dataset
- can read Explore
- can read ExploreFormDataRestApi
- can read ExplorePermalinkRestApi
- can view chart as table Dashboard
- can view query Dashboard
--
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: [I] View Query Not SHowing. [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #36500:
URL: https://github.com/apache/superset/issues/36500#issuecomment-3711568891
Are you able to check your permissions to see if the bot is right here? We've seen similar issues, and are not sure if that's the one-and-only solution 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: [I] View Query Not SHowing. [superset]
Posted by "adomass (via GitHub)" <gi...@apache.org>.
adomass commented on issue #36500:
URL: https://github.com/apache/superset/issues/36500#issuecomment-3713934218
The role does not help. We have similar issue from v5
--
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: [I] View Query Not SHowing. [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #36500:
URL: https://github.com/apache/superset/issues/36500#issuecomment-3640164553
<!-- Answer -->
The reason "View Query" is not working or is empty in embedded dashboards is due to permissions: embedded dashboards run under a guest/anonymous user context, which by default does not have the `can_view_query` permission. As a result, the "View Query" option is hidden or disabled for embedded viewers unless you explicitly grant this permission to the guest or Public role in your Superset security settings. There is no explicit code disabling "View Query" for embedded dashboards, but the lack of required permissions for guest users effectively prevents access to this feature in embedded mode [reference](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx#L151-L544).
If you want to enable "View Query" for embedded dashboards, you can grant the `can_view_query` permission on the "Dashboard" resource to the guest or Public role. Be aware that this will allow anyone with access to the embedded dashboard to view the underlying SQL queries, which may have security or data exposure implications depending on your use case.
If you update permissions and still don't see the feature, check for frontend or backend errors that might indicate another issue.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
---
<sup>How did I do? [Good](https://app.dosu.dev/response-feedback/f0aefbbd-faa5-4643-9103-26c725509f88?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/f0aefbbd-faa5-4643-9103-26c725509f88?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/f0aefbbd-faa5-4643-9103-26c725509f88?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/f0aefbbd-faa5-4643-9103-26c725509f88?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/f0aefbbd-faa5-4643-9103-26c725509f88?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/f0aefbbd-faa5-4643-9103-26c725509f88?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/f0aefbbd-faa5-4643-9103-26c725509f88?feedback_type=other)</sup>
[](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=The%20reason%20%22View%20Query%22%20is%20not%20working%20or%20is%20empty%20in%20embedded%20dashboards%20is%20due%20to%20permissions%3A%20embedded%20dashboards%20run%20under%20a%20guest/anonymous%20user%20context%2C%20which%20by%20default%20does%20not%20have%20the%20%60can_view_query%60%20permission.%20As%20a%20result%2C%20the%20%22View%20Query%22%20option%20is%20hidden%20or%20disabled%20for%20embedded%20viewers%20unless%20you%20explicitly%20grant%20this%20permission%20to%20the%20guest%20or%20Public%20role%20in%20your%20Superset%20security%20settings.%20There%20is%20no%20explicit%20code%20disabling%20%22View%20Query%22%20for%20embedded%20dashboards%2C%20but%20the%20lack%20of%20required%20permissions%20for%20guest%20users%20effectively%20prevents%20a
ccess%20to%20this%20feature%20in%20embedded%20mode%C2%A0%5Breference%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx%23L151-L544%29.%0A%0AIf%20you%20want%20to%20enable%20%22View%20Query%22%20for%20embedded%20dashboards%2C%20you%20can%20grant%20the%20%60can_view_query%60%20permission%20on%20the%20%22Dashboard%22%20resource%20to%20the%20guest%20or%20Public%20role.%20Be%20aware%20that%20this%20will%20allow%20anyone%20with%20access%20to%20the%20embedded%20dashboard%20to%20view%20the%20underlying%20SQL%20queries%2C%20which%20may%20have%20security%20or%20data%20exposure%20implications%20depending%20on%20your%20use%20case.%0A%0AIf%20you%20update%20permissions%20and%20still%20don%27t%20see%20the%20feature%2C%20check%20for%20frontend%20or%20backend%20errors%20that%20might%20indicate%20another%20issue.) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/36500)
--
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: [I] View Query Not SHowing. [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe closed issue #36500: View Query Not SHowing.
URL: https://github.com/apache/superset/issues/36500
--
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: [I] View Query Not SHowing. [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #36500:
URL: https://github.com/apache/superset/issues/36500#issuecomment-4748827440
There isn't quite enough here to reproduce the empty 'View query' in an embedded dashboard. Could you share the guest-token scope/permissions, the network response for the query call, and a minimal repro on a current release? Especially in 6.1 (or 6.0) if possible, as those are the officially suppored versions.
--
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: [I] View Query Not SHowing. [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on issue #36500:
URL: https://github.com/apache/superset/issues/36500#issuecomment-5722427015
Closing this out since https://github.com/apache/superset/pull/43151 is now merged. Feel free to open another issue if this isn't fixed.
--
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