Skip to content

Unable to get chart data through this API: api/v1/chart/{pk}/data/ #33615

Open
@singhs124

Description

@singhs124

Bug description

We are trying to fetch chart data using /api/v1/chart/2910/data API, but we are getting 400 response with message "Chart has no query context saved. Please save the chart again".
WorkAround: When we try hitting this API after manually opening the chart again, the API is able to fetch data. (We have around 100 charts because of which this workaround is not a feasible option for us)

P.S. We are using zip file to import dashboards

Screenshots/recordings

Image
Query Context is null, when hitting API: http://localhost:8088/api/v1/chart/2030

Image
Message after hitting API: http://localhost:8088/api/v1/chart/2030/data/

After Opening the Chart

Image
Query Context is populated

Image
Data is coming.

Superset version

4.0.2

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions