{"record":{"id":"babcf5b2747102c0","repo":"apache/superset","slug":"geojson-column-is-required-for-geojson-charts","errorCode":null,"errorMessage":"GeoJSON column is required for GeoJSON charts","messagePattern":"GeoJSON column is required for GeoJSON charts","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"superset-frontend/plugins/preset-chart-deckgl/src/layers/Geojson/buildQuery.ts","lineNumber":45,"sourceCode":"import { addTooltipColumnsToQuery } from '../buildQueryUtils';\n\nexport interface DeckGeoJsonFormData extends SqlaFormData {\n  geojson?: string;\n  filter_nulls?: boolean;\n  cross_filter_column?: string | null;\n  tooltip_contents?: unknown[];\n}\n\nexport default function buildQuery(formData: DeckGeoJsonFormData) {\n  const {\n    geojson,\n    filter_nulls = true,\n    cross_filter_column,\n    tooltip_contents,\n  } = formData;\n\n  if (!geojson) {\n    throw new Error('GeoJSON column is required for GeoJSON charts');\n  }\n\n  return buildQueryContext(formData, (baseQueryObject: QueryObject) => {\n    let columns: QueryFormColumn[] = [\n      ...ensureIsArray(baseQueryObject.columns || []),\n      geojson,\n    ];\n\n    if (cross_filter_column && !columns.includes(cross_filter_column)) {\n      columns.push(cross_filter_column);\n    }\n\n    // Add tooltip columns\n    columns = addTooltipColumnsToQuery(columns, tooltip_contents);\n\n    // Add null filter for geojson column\n    const filters: QueryObjectFilterClause[] = ensureIsArray(\n      baseQueryObject.filters || [],","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset-frontend/plugins/preset-chart-deckgl/src/layers/Geojson/buildQuery.ts#L27-L63","documentation":"Thrown by the deck.gl GeoJSON layer's buildQuery when the geojson form field is empty. The entire layer renders one GeoJSON feature per row, so the column holding the GeoJSON payload is indispensable; without it the query would return rows the renderer cannot draw. Fail-fast configuration guard raised before any SQL is generated.","triggerScenarios":"Running a Deck.gl GeoJSON chart where the 'GeoJSON Column' control is unset, or where saved/API-supplied params omit the geojson key (imported dashboards, chart duplication from a stub, dataset re-binding).","commonSituations":"Chart created but never fully configured then added to a dashboard; dataset schema drift removing the GeoJSON column; dashboards loaded from export JSON with incomplete form params.","solutions":["Open the chart in Explore and select the column containing GeoJSON payloads in the 'GeoJSON Column' control, then save.","Confirm the dataset still exposes that column (Calma / dataset editor) and re-bind if it was renamed.","When creating charts via the REST API, include geojson in params."],"exampleFix":"// before\nbuildQuery(formData); // formData.geojson undefined\n\n// after\nif (!formData.geojson) {\n  throw new Error('Select a GeoJSON column in the chart controls');\n}\nbuildQuery(formData);","handlingStrategy":"validation","validationCode":"if (!formData.geojson) {\n  throw new Error('Select a GeoJSON column before querying');\n}\nbuildQuery(formData);","typeGuard":"const hasGeojsonColumn = (fd: DeckGeoJsonFormData): boolean =>\n  typeof fd.geojson === 'string' && fd.geojson.length > 0;","tryCatchPattern":"try { buildQuery(formData); } catch (e) { if (e.message.includes('GeoJSON column')) showConfigToast(e.message); else throw e; }","preventionTips":["Require the GeoJSON control before chart save/run","Re-validate chart params after dataset schema changes"],"tags":["deckgl","geojson","buildquery","validation"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}