docs(carto-create-builder-maps): drop broken __aggregationValue pattern#12
Draft
anamanvil wants to merge 1 commit into
Draft
docs(carto-create-builder-maps): drop broken __aggregationValue pattern#12anamanvil wants to merge 1 commit into
anamanvil wants to merge 1 commit into
Conversation
…rn from layers.md §3
The skill prescribed `aggregationExp: "1 AS __aggregationValue, sum(col) as col_sum"`
as the canonical h3/quadbin/heatmapTile/clusterTile color-binding pattern. The
literal is rejected by the maps-api /stats SQL parser
(`{"error":"__aggregationvalue at [<col>]","status":400}`) when Builder hydrates
attribute stats on map open — validation passes, viewer renders, Builder 500s
with no obvious cause. Replace the example with the working real-column pattern
and add a warning callout explaining the failure mode for agents who encounter
the legacy form on round-trips.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
The carto-create-builder-maps skill's
references/layers.md§3 ("How to color a layer — three working shapes") prescribedaggregationExp: \"1 AS __aggregationValue, sum(col) as col_sum\"as the canonical color-binding pattern forh3/quadbin/heatmapTile/clusterTilelayers.That literal does not work on the live backend. When Builder hydrates attribute stats on map open, the maps-api
/v3/statsSQL parser rejects the synthetic__aggregationvalueidentifier with{\"error\":\"__aggregationvalue at [<col>]\",\"status":400}, producing an "Error getting attribute stats: Column not found" toast and a Builder 500. The CLI'smaps validateandmaps verify-remoteboth pass;/viewerrenders cleanly; only/builderfalls over.This PR replaces the example with the working raw-column + aggregation-alias pattern and adds an explicit "don't emit
1 AS __aggregationValueon new maps" callout for agents who encounter the legacy form on round-trips.Why this matters
I hit this while building a wildfire / cities map with the skill — followed the documented pattern verbatim, every CLI tier passed, Builder 500'd on load. Multiple iteration cycles trying alternative interpretations of the docs made it worse before I traced the failure to the literal in the example.
Validation
make validatepasses (21 skills, 229 snippets)Review focus
The replacement guidance — specifically the "just count rows per cell" recipe (add
1 AS incidentto the source SELECT, then aggregate assum(incident) as incident_sum). Confirm that's the path Builder consumers expect to see, vs. some other shape I might have missed.Related
Reproduced on map
418caaa7-c80c-42d8-9cab-2e4e1a099361in the CARTO CLI org (ac_h76o41fy). cloud-native PR to follow with a CLI pre-flight check that catches the column-not-found before map create returns.🤖 Generated with Claude Code