{"record":{"id":"5abe53258b89a6be","repo":"apache/superset","slug":"geohash-column-is-required-for-geohash-type","errorCode":null,"errorMessage":"Geohash column is required for geohash type","messagePattern":"Geohash column is required for geohash type","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"superset-frontend/plugins/preset-chart-deckgl/src/layers/spatialUtils.ts","lineNumber":95,"sourceCode":"\n  switch (spatial.type) {\n    case 'latlong':\n      if (!spatial.lonCol || !spatial.latCol) {\n        throw new Error(\n          'Longitude and latitude columns are required for latlong type',\n        );\n      }\n      return [spatial.lonCol, spatial.latCol];\n    case 'delimited':\n      if (!spatial.lonlatCol) {\n        throw new Error(\n          'Longitude/latitude column is required for delimited type',\n        );\n      }\n      return [spatial.lonlatCol];\n    case 'geohash':\n      if (!spatial.geohashCol) {\n        throw new Error('Geohash column is required for geohash type');\n      }\n      return [spatial.geohashCol];\n    default:\n      throw new Error(`Unknown spatial type: ${spatial.type}`);\n  }\n}\n\nexport function addSpatialNullFilters(\n  spatial: SpatialConfiguration,\n  filters: QueryObjectFilterClause[],\n): QueryObjectFilterClause[] {\n  if (!spatial) return filters;\n\n  const spatialColumns = getSpatialColumns(spatial);\n  const nullFilters: QueryObjectFilterClause[] = spatialColumns.map(column => ({\n    col: column,\n    op: 'IS NOT NULL',\n    val: null,","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset-frontend/plugins/preset-chart-deckgl/src/layers/spatialUtils.ts#L77-L113","documentation":"Thrown by getSpatialColumns when spatial.type is 'geohash' but geohashCol is missing. The geohash encoding maps a single geohash-string column to coordinates, so that column name is mandatory for the generated SQL. Companion check to the latlong/delimited branches of the same switch.","triggerScenarios":"A spatial config { type: 'geohash' } reaching getSpatialColumns without geohashCol — the geohash column control was cleared or never set, or params were serialized incompletely.","commonSituations":"Selecting geohash encoding without picking the geohash column; the geohash column removed from the dataset; imported chart params missing the column key.","solutions":["Choose the geohash column in the spatial control and save the chart.","Confirm the column exists in the dataset; restore/rename if drifted.","Set geohashCol in code whenever type === 'geohash'."],"exampleFix":"// before\ngetSpatialColumns({ type: 'geohash' }); // throws\n\n// after\ngetSpatialColumns({ type: 'geohash', geohashCol: 'geohash_4' });","handlingStrategy":"validation","validationCode":"if (spatial.type === 'geohash' && !spatial.geohashCol) {\n  throw new Error('geohash spatial needs geohashCol');\n}\ngetSpatialColumns(spatial);","typeGuard":"const isCompleteGeohash = (s: SpatialConfiguration): boolean =>\n  s.type !== 'geohash' || typeof s.geohashCol === 'string';","tryCatchPattern":"try { getSpatialColumns(spatial); } catch (e) { if (e.message.includes('geohash type')) promptForGeohashColumn(); else throw e; }","preventionTips":["Require the geohash column when that encoding is selected","Guard custom code paths that build geohash configs"],"tags":["deckgl","spatial","geohash","validation"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}