Bug description
I used a dataset macro in dataset sql with jinja template
select team_manager from {{ dataset(66) }}
And the dashboard works fine
But when I embedded it into frame with sdk, I 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
- [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.
- [ ] 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.
Comment From: dosubot[bot]
@shirley26107plus Hello! I'm here to help you with any bugs, questions, or contributions. Let's get to the bottom of this together.
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 [1].
Here are a few things you might want to check or try:
-
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.
-
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 [2].
-
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.
-
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.
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
Comment From: rusackas
Is this still happening on current master
? Wondering if anything changed after the SQLGlot migration.