feat(sqllab): accept results key via POST body

The SQL Lab results endpoint previously accepted the cached results key
(and optional row limit) only via the query string on a GET request. This
adds a POST variant of `/api/v1/sqllab/results/` that reads `{ "key": ...,
"rows": ... }` from the JSON request body, sharing the exact same handler
logic and `can_get_results` permission as the GET. The frontend now sends
the key in the POST body so it no longer appears in the query string.

The existing GET endpoint is retained unchanged for backward compatibility.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Claude Code
2026-06-01 16:45:11 -07:00
parent 87be424f9c
commit eec8dbce47
5 changed files with 170 additions and 10 deletions

View File

@@ -482,14 +482,14 @@ export function fetchQueryResults(
const { SQLLAB_QUERY_RESULT_TIMEOUT } = getState().common?.conf ?? {};
dispatch(requestQueryResults(query));
const queryParams = rison.encode({
key: query.resultsKey,
rows: displayLimit || null,
});
const timeout = timeoutInMs ?? SQLLAB_QUERY_RESULT_TIMEOUT;
const controller = new AbortController();
return SupersetClient.get({
endpoint: `/api/v1/sqllab/results/?q=${queryParams}`,
return SupersetClient.post({
endpoint: `/api/v1/sqllab/results/`,
jsonPayload: {
key: query.resultsKey,
rows: displayLimit || null,
},
parseMethod: 'json-bigint',
...(timeout && { timeout, signal: controller.signal }),
})