{"record":{"id":"62c6d030809a5b6e","repo":"apache/superset","slug":"invalid-result-type-result-type-s","errorCode":null,"errorMessage":"Invalid result type: %(result_type)s","messagePattern":"Invalid result type: (.+?)","errorType":"validation","errorClass":"QueryObjectValidationError","httpStatus":400,"severity":"error","filePath":"superset/common/query_actions.py","lineNumber":358,"sourceCode":"    query_context: QueryContext,\n    query_obj: QueryObject,\n    force_cached: bool,\n) -> QueryDataResult:\n    \"\"\"\n    Return result payload and timing without storing timing in the payload.\n\n    The total interval begins before result-family preparation and dispatch.\n    Metadata result types do not acquire dataframe state, so their phase values\n    are null while the measured total remains available.\n    \"\"\"\n    started_ns = time.perf_counter_ns()\n    if result_func := _metadata_result_type_functions.get(result_type):\n        payload = result_func(query_context, query_obj, force_cached)\n        total_ns = max(0, time.perf_counter_ns() - started_ns)\n        return QueryDataResult(payload=payload, timing=_metadata_timing(total_ns))\n\n    if result_type not in _data_result_type_preparers:\n        raise QueryObjectValidationError(\n            _(\"Invalid result type: %(result_type)s\", result_type=result_type)\n        )\n\n    if preparer := _data_result_type_preparers[result_type]:\n        query_obj = preparer(query_context, query_obj)\n\n    payload, acquisition_timing, action_assembly_ns = _get_full_with_timing(\n        query_context,\n        query_obj,\n        force_cached,\n    )\n    total_ns = max(0, time.perf_counter_ns() - started_ns)\n    return QueryDataResult(\n        payload=payload,\n        timing=QueryTiming(\n            query_planning_ns=acquisition_timing.query_planning_ns,\n            cache_resolution_ns=acquisition_timing.cache_resolution_ns,\n            data_acquisition_ns=acquisition_timing.data_acquisition_ns,","sourceCodeStart":340,"sourceCodeEnd":376,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/common/query_actions.py#L340-L376","documentation":"In _get_result execution dispatch, after checking the metadata result-type registry, an unknown result_type string raises QueryObjectValidationError('Invalid result type: %(result_type)s'). Valid values are the keys of _metadata_result_type_functions and _data_result_type_preparers (e.g. 'results', 'samples', 'full', and the metadata types like 'col_form','metrics_list', etc., varying by version).","triggerScenarios":"Submitting /api/v1/chart/data or a query context with result_type not in the supported set — e.g. 'full' vs 'results' confusion across versions, typos, or a client built against a different Superset version whose result types differ.","commonSituations":"Version skew between superset-ui client and backend; hand-rolled API clients; feature branches that rename result types.","solutions":["Check the accepted result types in the installed superset/common/query_actions.py registries and use one of those strings.","Upgrade frontend/backend in lockstep so client-sent result types exist server-side.","Remove custom result_type values from payloads before sending."],"exampleFix":"# before\n{\"result_type\": \"full\", ...}  # not registered on this backend\n\n# after\n{\"result_type\": \"results\", ...}  # key present in _data_result_type_preparers","handlingStrategy":"validation","validationCode":"from superset.common import query_actions\nvalid = set(query_actions._metadata_result_type_functions) | set(\n    query_actions._data_result_type_preparers\n)\nassert result_type in valid, f\"unsupported result_type {result_type}\"","typeGuard":"def is_valid_result_type(rt: str) -> bool:\n    return rt in {\"results\", \"samples\", \"col_form\", \"metrics_list\"}  # verify per version","tryCatchPattern":"except QueryObjectValidationError as e:\n    if \"Invalid result type\" in str(e):\n        result_type = \"results\"  # safe default, retry once","preventionTips":["Pin superset-ui and backend versions together","Whitelist result types client-side before send"],"tags":["query","result-type","validation","backend"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}