thalmis-zt opened a new issue, #31956:
URL: https://github.com/apache/superset/issues/31956
### 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.
```sql
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)
```sql
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, 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
- [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.
- [x] 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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]