{"record":{"id":"847641a6bffa24e2","repo":"apache/superset","slug":"spatial-configuration-is-required-for-scatter-char","errorCode":null,"errorMessage":"Spatial configuration is required for Scatter charts","messagePattern":"Spatial configuration is required for Scatter charts","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"superset-frontend/plugins/preset-chart-deckgl/src/layers/Scatter/buildQuery.ts","lineNumber":57,"sourceCode":"  point_radius_fixed?:\n    | string // Legacy format: metric name directly\n    | {\n        type?: 'fix' | 'metric';\n        value?: QueryFormMetric | number;\n      };\n  multiplier?: number;\n  point_unit?: string;\n  min_radius?: number;\n  max_radius?: number;\n  color_picker?: { r: number; g: number; b: number; a: number };\n  dimension?: string;\n}\n\nexport default function buildQuery(formData: DeckScatterFormData) {\n  const { spatial, point_radius_fixed, dimension, tooltip_contents } = formData;\n\n  if (!spatial) {\n    throw new Error('Spatial configuration is required for Scatter charts');\n  }\n\n  return buildQueryContext(formData, {\n    buildQuery: (baseQueryObject: QueryObject) => {\n      const spatialColumns = getSpatialColumns(spatial);\n      let columns = [...(baseQueryObject.columns || []), ...spatialColumns];\n\n      if (dimension) {\n        columns.push(dimension);\n      }\n\n      columns = addTooltipColumnsToQuery(columns, tooltip_contents);\n\n      // Only add metric if point_radius_fixed is a metric type\n      const isMetric = isMetricValue(point_radius_fixed);\n      // Extract metric value: legacy string format or object with metric value\n      const rawValue =\n        typeof point_radius_fixed === 'string'","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset-frontend/plugins/preset-chart-deckgl/src/layers/Scatter/buildQuery.ts#L39-L75","documentation":"Thrown by the deck.gl Scatter layer's buildQuery when the spatial form field is absent. A scatter point is placed entirely by its spatial configuration (latlong columns, delimited lon/lat column, or geohash), so buildQuery refuses to proceed without it. Configuration-time guard, raised before getSpatialColumns or any SQL assembly.","triggerScenarios":"Building the query for a Deck.gl Scatter chart whose spatial control is unset — newly added chart, imported dashboard params missing 'spatial', or a query context constructed without the key.","commonSituations":"Chart saved half-configured; spatial columns removed from the dataset; switching a chart between spatial encodings leaving an empty object; programmatic chart creation with partial params.","solutions":["Open the Scatter chart in Explore and configure the spatial control (latlong / delimited / geohash), then save.","Confirm the bound columns still exist in the dataset; rebind after schema changes.","Populate formData.spatial before calling buildQuery in code."],"exampleFix":"// before\nbuildQuery(formData); // spatial undefined\n\n// after\nif (!formData.spatial) {\n  throw new Error('Configure the spatial control first');\n}\nbuildQuery(formData);","handlingStrategy":"validation","validationCode":"if (!formData.spatial) {\n  throw new Error('Configure the spatial control before querying');\n}\nbuildQuery(formData);","typeGuard":"const hasSpatial = (fd: DeckScatterFormData): boolean => Boolean(fd.spatial?.type);","tryCatchPattern":"try { buildQuery(formData); } catch (e) { if (e.message.includes('Spatial configuration')) showExploreWarning(e.message); else throw e; }","preventionTips":["Require the spatial control before chart save","Normalize spatial objects (never undefined/null) when transforming form data"],"tags":["deckgl","scatter","spatial","buildquery","validation"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}