You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "shirley26107plus (via GitHub)" <gi...@apache.org> on 2025/03/28 07:41:36 UTC
[I] Embedded dashboard cannot support dataset macro in sql template [superset]
shirley26107plus opened a new issue, #32894:
URL: https://github.com/apache/superset/issues/32894
### Bug description
I used a dataset macro in dataset sql with jinja template
<img width="1344" alt="Image" src="https://github.com/user-attachments/assets/3bca47c5-3c70-43d9-9afd-467363ed3906" />
`select team_manager from {{ dataset(66) }}
`
And the dashboard works fine

But when I embedded it into frame with sdk, it got an error like this:

### Screenshots/recordings
_No response_
### Superset version
master / latest-dev
### Python version
3.9
### Node version
16
### Browser
Chrome
### Additional context
_No response_
### Checklist
- [ ] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [ ] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [ ] 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] Embedded dashboard cannot support dataset macro in sql template [superset]
Posted by "ikstewa (via GitHub)" <gi...@apache.org>.
ikstewa commented on issue #32894:
URL: https://github.com/apache/superset/issues/32894#issuecomment-3300182716
We run into the same issue when using the `metric()` macro with an embed. I believe it fails for the same reason that it is trying to do a dataset lookup, even if the dataset is the one the macro is being ran from:
https://github.com/apache/superset/blob/05c6a1bf200a916ce152b669735d8fd53a8b87aa/superset/jinja_context.py#L1067-L1109
--
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] Embedded dashboard cannot support dataset macro in sql template [superset]
Posted by "Vitor-Avila (via GitHub)" <gi...@apache.org>.
Vitor-Avila commented on issue #32894:
URL: https://github.com/apache/superset/issues/32894#issuecomment-3459492125
Fixed with https://github.com/apache/superset/pull/35508
--
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] Embedded dashboard cannot support dataset macro in sql template [superset]
Posted by "Vitor-Avila (via GitHub)" <gi...@apache.org>.
Vitor-Avila closed issue #32894: Embedded dashboard cannot support dataset macro in sql template
URL: https://github.com/apache/superset/issues/32894
--
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] Embedded dashboard cannot support dataset macro in sql template [superset]
Posted by "tal952 (via GitHub)" <gi...@apache.org>.
tal952 commented on issue #32894:
URL: https://github.com/apache/superset/issues/32894#issuecomment-3744889586
This is still happening, the https://github.com/apache/superset/pull/35508 only fixed the metric_macro, not dataset_macro. I'm not familiar enough with superset, is it the same fix?
--
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] Embedded dashboard cannot support dataset macro in sql template [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #32894:
URL: https://github.com/apache/superset/issues/32894#issuecomment-3006513952
Is this still happening on current `master`? Wondering if anything changed after the SQLGlot migration.
--
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] Embedded dashboard cannot support dataset macro in sql template [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #32894:
URL: https://github.com/apache/superset/issues/32894#issuecomment-2760460644
<!-- Greeting -->
@shirley26107plus Hello! I'm here to help you with any bugs, questions, or contributions. Let's get to the bottom of this together.
<!-- Answer -->
The error you're encountering, "Unexpected error: Dataset 66 not found!", when embedding a dashboard using the SDK, might be related to how dataset macros are resolved in different environments. In Superset, dataset identifiers like 'dataset(66)' are resolved using the `dataset_macro` function, which retrieves the dataset by its ID and constructs a SQL query string for use in SQL templates <sup>[[1]](https://github.com/apache/superset/blob/master/superset/jinja_context.py)</sup>.
Here are a few things you might want to check or try:
1. **Dataset Access**: Ensure that the dataset with ID 66 is accessible in the environment where the embedded dashboard is being used. There might be permission or access control issues when using the SDK.
2. **SDK Configuration**: Verify that the SDK is correctly configured to handle dataset macros. There might be specific configurations or permissions required for accessing datasets in embedded dashboards, although I couldn't find specific details on this <sup>[[2]](https://github.com/apache/superset/blob/master/superset-embedded-sdk/README.md)</sup>.
3. **Environment Consistency**: Check if there are any differences between the Superset environment where the dashboard works and the environment where it is embedded. This includes checking for any discrepancies in dataset availability or configuration.
4. **Logs and Debugging**: Look into the Superset logs for any additional error messages or stack traces that might provide more context on why the dataset is not being found.
If these steps don't resolve the issue, further investigation into the specific configurations and permissions for the embedded environment might be necessary.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
---
<sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/68ce3619-ce36-4bce-9801-57ffcef226c6?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/68ce3619-ce36-4bce-9801-57ffcef226c6?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/68ce3619-ce36-4bce-9801-57ffcef226c6?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/68ce3619-ce36-4bce-9801-57ffcef226c6?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/68ce3619-ce36-4bce-9801-57ffcef226c6?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/68ce3619-ce36-4bce-9801-57ffcef226c6?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/68ce3619-ce36-4bce-9801-57ffcef226c6?feedback_type=other)</sup>
--
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