You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OBJECTIVE:
Create a chart which can be embedded in an external website. The chart should be filterable by passing filter values as url params.
STEPS FOLLOWED:
Created an sql query in SQL lab with jinja templating to allow custom url params.
SELECT rseti,course_id,state, course_name
FROM course_overview
WHERE state ='{{ url_param("state_value","238") }}'AND course_name <='{{url_param("course_name","12")}}'
Saved the query and Hit create chart
Named the chart as “Demo Chart” and saved it.
Copied the embed src and pasted in a new tab to view the chart.
Chart is working fine as expected, with the state_value param filter being applied.
Now, suppose I wish to edit the chart at a later point, which is best done by editing the sql query itself.
To do that, I go to Charts menu in Superset UI and click on the desired chart.
In chart Explore page, I select the View in SQL Lab option
I modified the query , to avoid the rseti column ( as below)
SELECT course_id,state, course_name
FROM course_overview
WHERE state ='{{ url_param("state_value","238") }}'AND course_name <='{{url_param("course_name","12")}}'
Satisfied with the results, I hit Save button. Got a message saying query has been saved.
Now, I go back to the tab where the earlier embed src is used and hit refresh, expecting that the ‘rseti’ column would have been removed from there as well. But, it isnt.
Screenshots/recordings
No response
Superset version
master / latest-dev
Python version
3.10
Node version
18 or greater
Browser
Chrome
Additional context
Superset logs No errors found. Adding it in case it helps.
2025-01-22 13:04:56,717:DEBUG:superset.sql_parse:Parsing with sqlparse statement: SELECT rseti AS rseti,
superset_app | course_id AS course_id,
superset_app | state AS state,
superset_app | course_name AS course_name
superset_app | FROM
superset_app | (SELECT rseti,
superset_app | course_id,
superset_app | state,
superset_app | course_name
superset_app | FROM course_overview
superset_app | WHERE state = '263'
superset_app | AND course_name <= '12') AS virtual_table
superset_app | LIMIT 1000
I found a similar closed issue that might be relevant to your problem. The suggested solution in that issue was to save the new virtual dataset and then sync the columns. This process is explained in a video. Additionally, the "sync columns" button is necessary, and its location is explained in the documentation[1].
The 'sync columns' button is located under the "Columns" tab within the Datasource Editor. You can find it by navigating to the "Columns" tab and looking for the button labeled "Sync columns from source" [2][3].
Try syncing the columns after saving your changes to ensure that the updated SQL query is reflected in your chart.
Ahh.... I think this is just workflow confusion, which maybe @kasiazjc would have ideas on how to clarify/improve.
If you had clicked "Edit dataset" instead of "View in SQL Lab" you could edit your dataset SQL directly. However, when you "view" the query in SQL lab, it's not editing the existing dataset, just taking the SQL over there to tinker with.
When you clicked the "Save" button, you probably saved the query as a Saved Query... but this again does not edit the dataset powering your chart. Instead, you'd click the little dropdown button next to the Save button and select "Save Dataset." This gives you the option to either create a NEW dataset, or find and overwrite the dataset that is/was powering your Chart.
Hope that makes sense and is enough to close the issue, but maybe this is something we can iron out or make clearer?
The approach you suggested isn't working for me. As suggested, I overwrote the dataset by clicking on the 'Save dataset' in dropdown.
On clicking overwrite and explore, I am redirected to the explore charts page. I do not want to create a new chart, assuming that my only requirement is to add a new column to the table chart. Since, the dataset was edited, I expect the charts consuming the dataset will automatically update.
I refreshed the page which had the chart embedding. But, the column wasn't added.
My doubt is, do we have to update the chart embed link each time I update the dataset?
Bug description
OBJECTIVE:
Create a chart which can be embedded in an external website. The chart should be filterable by passing filter values as url params.
STEPS FOLLOWED:
Created an sql query in SQL lab with jinja templating to allow custom url params.
Saved the query and Hit create chart
Named the chart as “Demo Chart” and saved it.
Copied the embed src and pasted in a new tab to view the chart.
Chart is working fine as expected, with the
state_value
param filter being applied.Now, suppose I wish to edit the chart at a later point, which is best done by editing the sql query itself.
To do that, I go to Charts menu in Superset UI and click on the desired chart.
In chart Explore page, I select the View in SQL Lab option
I modified the query , to avoid the rseti column ( as below)
Satisfied with the results, I hit Save button. Got a message saying query has been saved.
Now, I go back to the tab where the earlier embed src is used and hit refresh, expecting that the ‘rseti’ column would have been removed from there as well. But, it isnt.
Screenshots/recordings
No response
Superset version
master / latest-dev
Python version
3.10
Node version
18 or greater
Browser
Chrome
Additional context
Superset logs
No errors found. Adding it in case it helps.
2025-01-22 13:04:56,717:DEBUG:superset.sql_parse:Parsing with sqlparse statement: SELECT rseti AS rseti,
superset_app | course_id AS course_id,
superset_app | state AS state,
superset_app | course_name AS course_name
superset_app | FROM
superset_app | (SELECT rseti,
superset_app | course_id,
superset_app | state,
superset_app | course_name
superset_app | FROM course_overview
superset_app | WHERE state = '263'
superset_app | AND course_name <= '12') AS virtual_table
superset_app | LIMIT 1000
"POST
/superset/log/?explode=events HTTP/1.1" 200 1 "http://localhost:8088/superset/explore/p/pP0mYgvz2Jb/?state_value=263&standalone=1&height=400"
Checklist
The text was updated successfully, but these errors were encountered: