"error": "Dataset schema is invalid, caused by: QueryContextFactory.create() missing 2 required keyword-only arguments: 'datasource' and 'queries'"
- Dominant language
- Python
- Stars
- 74.8k
- Forks
- 18.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 664
Description
### Bug description
I'm using Superset version 5, and since I started using it, I’ve been seeing the toast message:
“Error loading chart datasources”
(status 422 in the browser console)
This happens every time I create a new dashboard.
From my investigation, it seems this error is caused by a bug during the creation of charts and native filters. In the internal metadata database, I found that some of my charts and filters were missing the datasource and queries fields in their metadata.
I tried manually updating these values (using AI-generated SQL queries), and although the flags changed from `"t"` to `"f"`, the toast message still appears. For a while I just hid the message, but when I try to use the export data API, this error prevents the chart data from being returned.
### Screenshots/recordings
_No response_
### Superset version
5.0.0
### Python version
I don't know
### 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.
Contributor guide
Assessment
This issue has not been assessed yet.