Skip to content

"error": "Dataset schema is invalid, caused by: QueryContextFactory.create() missing 2 required keyword-only arguments: 'datasource' and 'queries'" #35774

Description

@PedroChinalia

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

  • 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.

Metadata

Metadata

Assignees

Labels

apiRelated to the REST APIapi:chartsRelated to the REST endpoints of chartsvalidation:requiredA committer should validate the issue

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions