Repository navigation
Conversation
The spatial geom declares the geometry aesthetic as required, but execution auto-detects the geometry column from the result schema (detect_geometry_column in execute/mod.rs). Schema-less validate() has no schema to detect from, so it rejected any spatial query relying on auto-detection with "Layer 'spatial' mapping requires the geometry aesthetic" — a false rejection of queries that execute fine. When a geom declares a geometry aesthetic, treat the mapping as satisfied during schema-less validation, mirroring the execution-time contract. Adds regression tests for the canonical map patterns (choropleth, point map, orthographic globe), which all rely on auto-detection.
cpsievert
force-pushed
the
fix/validate-spatial-geometry-autodetect
branch
from
October 14, 2026 15:01
9637bea to
85b0657
Compare
cpsievert
marked this pull request as ready for review
October 14, 2026 15:23
teunbrand
approved these changes
Oct 15, 2026
Collaborator
|
Thanks for the fix Carson! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #587.
Fix
When a geom declares a
geometryaesthetic, insert a placeholder mapping before the required-aesthetic check in schema-less validation, mirroring the execution-time contract (geometry is required, but may come from auto-detection). The placeholder is internal to the validation pass:Validateddoesn't expose mappings, andexecute_with_readerre-parses the query independently.Alternative considered: an "auto-detectable" variant of
DefaultAestheticValue, so the contract lives in geom metadata rather than a validate-side special case. Chose the minimal fix; happy to reshape.Tests
test_validate_spatial_geometry_mapping_optional— spatial layer with and without an explicitgeometrymapping.test_validate_spatial_map_patterns— the canonical map patterns end-to-end throughvalidate(): choropleth (join toggsql:world, fill-only mapping), point map (null-sentinel fill, layer-levelFROM,PROJECT TO), orthographic globe (SETTING origin). All rely on auto-detection.Verified the issue's Rust repro prints
valid = true/execute(): OKon this branch (vsvalid = false/execute(): OKonmain).Found via querychat's maps capability, which pre-flight-validates LLM-generated queries with
ggsql.validate().