Warm up charts cache via API #38718
-
|
I need to warm up cache via API if data changed in dataset, and charts were updated my logic GET /api/v1/explore/?slice_id=1 - get form data When I do request on explore HTTP 403 status is returned My custom role has almost all permissions for charts and data |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 16 replies
-
|
You don't need the Simplified workflow: Just call the warm up endpoint directly: PUT /api/v1/chart/warm_up_cache
Content-Type: application/json
{
"chart_id": 1,
"dashboard_id": 123, // optional
"extra_filters": [] // optional
}This endpoint fetches the chart config, executes the query with Why you're getting 403: Your permissions target Permissions needed for your simplified approach: For ["Chart", "can_write"]Note: If your charts use Row Level Security (RLS) or user-specific Jinja macros like To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
Encountering charts.WarmUpError: unhashable type: 'list' during
warm_up_cache. Any idea why this error is occurring, especially with lists
in the query context? @dosu
…On Sun, Mar 22, 2026, 8:23 AM Rostislav Aleev ***@***.***> wrote:
@dosu <https://github.com/dosu>
I have created manually query_context and chart updated
{"datasource":{"id":344,"type":"table"},"force":false,"queries":[{"filters":[{"col":"Variable","op":"IN","val":"speed"}],"extras":{"having":"","where":""},"applied_time_extras":{},"columns":[{"columnType":"BASE_AXIS","sqlExpression":"x","label":"x","expressionType":"SQL","isColumnReference":true},"Group"],"metrics":[{"aggregate":"COUNT_DISTINCT","column":{"advanced_data_type":null,"changed_on":"2026-03-22T11:07:28.809501","column_name":"data_fact","create_on":null,"description":null,"expression":"","filterable":true,"groupby":true,"id":1727,"is_active":true,"is_dttm":false,"python_date_format":null,"type":"DOUBLE
PRECISION","type_generic":0,"uuid":"36cd406c-391c-4049-845c-bd913e5b0677","verbose_name":null},"datasourceWarning":false,"expressionType":"SIMPLE","hasCustomLabel":true,"label":"COUNT_DISTINCT(COUNT
DISTINCT(speed))","optionName":"metric_7d720999-8114-4494-a05a-b3d6f836a68a","sqlExpression":null}],"orderby":[[{"aggregate":"COUNT_DISTINCT","column":{"advanced_data_type":null,"changed_on":"2026-03-22T11:07:28.809501","column_name":"data_fact","create_on":null,"description":null,"expression":"","filterable":true,"groupby":true,"id":1727,"is_active":true,"is_dttm":false,"python_date_format":null,"type":"DOUBLE
PRECISION","type_generic":0,"uuid":"36cd406c-391c-4049-845c-bd913e5b0677","verbose_name":null},"datasourceWarning":false,"expressionType":"SIMPLE","hasCustomLabel":true,"label":"COUNT_DISTINCT(COUNT
DISTINCT(speed))","optionName":"metric_7d720999-8114-4494-a05a-b3d6f836a68a","sqlExpression":null},false]],"annotation_layers":[],"series_columns":["Group"],"series_limit":0,"group_others_when_limit_reached":false,"order_desc":true,"url_params":{},"custom_params":{},"custom_form_data":{},"time_offsets":[],"post_processing":[{"operation":"pivot","options":{"index":["x"],"columns":["Group"],"aggregates":{"COUNT_DISTINCT(COUNT
DISTINCT(speed))":{"operator":"mean"}},"drop_missing_columns":false}},{"operation":"rename","options":{"columns":{"COUNT_DISTINCT(COUNT
DISTINCT(speed))":null},"level":0,"inplace":true}},{"operation":"contribution","options":{"orientation":"row","time_shifts":[]}},{"operation":"flatten"}]}],"form_data":{"adhoc_filters":[{"clause":"WHERE","comparator":"speed","expressionType":"SIMPLE","operator":"IN","subject":"Variable"}],"contributionMode":"row","dashboards":[275],"datasource":"344__table","groupby":["Group"],"legendOrientation":"bottom","legendType":"plain","metrics":[{"aggregate":"COUNT_DISTINCT","column":{"advanced_data_type":null,"changed_on":"2026-03-22T11:07:28.809501","column_name":"data_fact","create_on":null,"description":null,"expression":"","filterable":true,"groupby":true,"id":1727,"is_active":true,"is_dttm":false,"python_date_format":null,"type":"DOUBLE
PRECISION","type_generic":0,"uuid":"36cd406c-391c-4049-845c-bd913e5b0677","verbose_name":null},"datasourceWarning":false,"expressionType":"SIMPLE","hasCustomLabel":true,"label":"COUNT_DISTINCT(COUNT
DISTINCT(speed))","optionName":"metric_7d720999-8114-4494-a05a-b3d6f836a68a","sqlExpression":null}],"minorSplitLine":true,"only_total":true,"orientation":"horizontal","rich_tooltip":false,"seriesType":"bar","show_empty_columns":true,"show_legend":true,"show_value":true,"slice_id":803,"sort_series_type":"COUNT_DISTINCT","stack":"Stack","tooltipTimeFormat":"%d/%m/%Y","truncateXAxis":false,"truncate_metric":true,"viz_type":"echarts_timeseries","xAxisLabelRotation":"0","x_axis":"x","x_axis_sort_series":"name","x_axis_sort_series_ascending":true,"x_axis_time_format":"%d/%m/%Y","x_axis_title":"status_tab","x_axis_title_margin":30,"y_axis_bounds":[null,null],"y_axis_format":",d","y_axis_title":"COUNT
DISTINCT(speed)","y_axis_title_margin":30,"y_axis_title_position":"Left","force":false,"result_format":"json","result_type":"full"},"result_format":"json","result_type":"full"}
when I try warm_up_cache error raised, but I don't see traceback in
superset web logs
charts.WarmUpError: unhashable type: 'list'
—
Reply to this email directly, view it on GitHub
<#38718?email_source=notifications&email_token=B72HASJNITFIIIUGZMJMWSD4R7SNJA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCNRSGU3TMNZXUZZGKYLTN5XKU43VMJZWG4TJMJSWJJLFOZSW45FMMZXW65DFOJPWG3DJMNVQ#discussioncomment-16257677>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/B72HASJGOG6HOPYWDT2M6UD4R7SNJAVCNFSM6AAAAACWWJYZPSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTMMRVG43DONY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
@dosu new error raised Error: Referenced columns not available in DataFrame. but chart works fine. I have created it via API and fetched as embedded via SDK. Do I need to patch anything or only suppress error? |
Beta Was this translation helpful? Give feedback.
Yes, you can create a chart with
query_contextin a single API call — no need to create first and update later.The ChartPostSchema accepts
query_contextas an optional field during chart creation:So your workflow can be:
params(form_data) andquery_contextJSON stringswarm_up_cachewill work immediately sincequery_contextis already storedTo reply, just mention @dosu.