championble3 commented on issue #45237:
URL: https://github.com/apache/superset/issues/45237#issuecomment-6162425320

   Thanks for the quick fix in 
[apache/superset#45250](https://github.com/apache/superset/pull/45250), the 
warning in insights is a big help.
   
   One question about the longer-term picture, because it decides how we 
document this for our users: is re-saving the chart in Explore intended to 
remain the only way to get exact numbers from get_chart_data for charts created 
or edited through MCP?
   
   As far as I can tell, generate_chart never stores a query_context, and 
update_chart now clears it, so every chart made or changed through MCP ends up 
in the fallback path, which skips the frontend buildQuery logic (time grain, 
trend line, period comparison, SQL columns). For those chart types the numbers 
differ from the dashboard until someone opens the chart in Explore and saves it.
   
   Is there a plan or an appetite for either:
   
   generating and persisting a query_context on the backend when MCP creates or 
updates a chart, or
   having get_chart_data reuse the viz plugin’s query building so the fallback 
matches the dashboard?
   
   If neither is planned, a note in the get_chart_data / generate_chart tool 
descriptions saying that charts need to be saved from Explore for exact results 
would at least set the right expectation for MCP clients.
   
   One data point from testing on 6.1.0, in case it helps the form_data_key 
discussion in the review: for a monthly bar chart, get_chart_data with an 
unsaved form_data_key returned a single total (the sum of all months), while 
the saved chart returned one row per month. So the unsaved path also skips the 
time grain and gives a misleading number without a caveat.


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