Skip to content

docs(carto-create-builder-maps): drop broken __aggregationValue pattern#12

Draft
anamanvil wants to merge 1 commit into
masterfrom
fix/aggregation-value-broken-pattern
Draft

docs(carto-create-builder-maps): drop broken __aggregationValue pattern#12
anamanvil wants to merge 1 commit into
masterfrom
fix/aggregation-value-broken-pattern

Conversation

@anamanvil

Copy link
Copy Markdown
Contributor

Summary

The carto-create-builder-maps skill's references/layers.md §3 ("How to color a layer — three working shapes") prescribed aggregationExp: \"1 AS __aggregationValue, sum(col) as col_sum\" as the canonical color-binding pattern for h3 / quadbin / heatmapTile / clusterTile layers.

That literal does not work on the live backend. When Builder hydrates attribute stats on map open, the maps-api /v3/stats SQL parser rejects the synthetic __aggregationvalue identifier with {\"error\":\"__aggregationvalue at [<col>]\",\"status":400}, producing an "Error getting attribute stats: Column not found" toast and a Builder 500. The CLI's maps validate and maps verify-remote both pass; /viewer renders cleanly; only /builder falls over.

This PR replaces the example with the working raw-column + aggregation-alias pattern and adds an explicit "don't emit 1 AS __aggregationValue on 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 validate passes (21 skills, 229 snippets)
  • No code paths changed; pure docs

Review focus

The replacement guidance — specifically the "just count rows per cell" recipe (add 1 AS incident to the source SELECT, then aggregate as sum(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-2e4e1a099361 in 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

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant