rbu101 opened a new issue, #38976:
URL: https://github.com/apache/superset/issues/38976

   ### Bug description
   
   ### Describe the bug
   When I create a dashboard with a "filter_select" chart (dropdown/slicer) via 
API or script, the chart appears in the dashboard but does not work as a filter 
and gives the error: "Data error: Error: Empty query?". Only after I manually 
open and save the chart in the Superset UI does the filter start working as 
expected.
   
   ### To Reproduce
   
   1. Create a dashboard with a "filter_select" chart using the Superset API 
(e.g., POST /api/v1/chart/ and /api/v1/dashboard/) or via automation/script.
   2. Open the dashboard – the filter does not work.
   3. Open the chart in Explore mode, click "Save" (no changes needed).
   4. Now the filter works as expected in the dashboard.
   
   ### Expected behavior
   The filter chart should work as a filter immediately after being created via 
API/script, without requiring a manual save in the UI.
   
   ### Screenshots:
   <img width="592" height="237" alt="Image" 
src="https://github.com/user-attachments/assets/016f376b-6d0f-4113-8e6e-00d29e646929";
 />
   <img width="1907" height="942" alt="Image" 
src="https://github.com/user-attachments/assets/599b505c-bf89-4dea-bced-6f35df5ee45b";
 />
   <img width="788" height="487" alt="Image" 
src="https://github.com/user-attachments/assets/c86ff14d-9de0-44fd-a383-81a7730a572a";
 />
   <img width="664" height="530" alt="Image" 
src="https://github.com/user-attachments/assets/5d3e0ff0-1689-4915-9024-0c3f9e7e96c6";
 />
   
   ### What I have tried
   - I have already tried to programmatically trigger a "Save" and "Go to 
Dashboard" for each chart after creation, using the Superset API.
   - Specifically, after creating the dashboard and charts via API/scripts, I 
used additional API calls (PUT /api/v1/chart/) to update and "save" each chart, 
mimicking the manual save action in the UI.
   - Despite this, the filter_select charts still do not work as filters until 
I manually open and save them in the Superset Explore UI.
   - I also attempted to repair chart metadata (datasource/query_context) and 
trigger a no-op save for all charts after dashboard creation, but this did not 
resolve the issue.
   
   
   ### Environment:
   - Superset version: 5.0.0
   - Python: 3.13
   - Database backend: Postgres
   - Deployment: Docker, local
   - Browser: Firefox
   
   ### Additional context:
   - The issue occurs with both single and multi-tab dashboards.
   - Workaround: Manually saving each chart in the UI fixes the problem.
   - I am using automated migration scripts to create dashboards and charts.
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   5.0.0
   
   ### Python version
   
   I don't know
   
   ### Node version
   
   I don't know
   
   ### Browser
   
   Firefox
   
   ### 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.
   - [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]

Reply via email to