Skip to content

FiboaBaseConverter: make id mean something - #265

Open
ivorbosloper wants to merge 1 commit into
split/base-dropsfrom
split/base-identity
Open

FiboaBaseConverter: make id mean something#265
ivorbosloper wants to merge 1 commit into
split/base-dropsfrom
split/base-identity

Conversation

@ivorbosloper

@ivorbosloper ivorbosloper commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Based on #264, not on main, because both touch the same file — review that one first. Four rules, each broken somewhere in the published catalog without anything noticing.

rule what it caught
a converter must map something to id de_bb and de_nds were published with no identifier at all — the base drops columns no mapping names, and the file validates. sk is the subtler half: index_as_id fills the column and the same drop removes it, because columns never named it
the column must be in the source si 2019 names the field POLJINA_ID where later campaigns name it ID; 820,151 fields were written with no id, and that validated too
the values must be unique an audit found 36 collections whose latest edition repeats an id: es_cl gave 9,109,136 fields the id "0", us_usda_cropland 3,093 ids to 7.5M fields
not both sources and variants sources wins, so --variant 2011 converts whatever sources points at — hr would have published thirteen copies of one file

The uniqueness check runs before geometries are exploded and ignores rows with no id (those are #264's bounded drop), and it reads tuple targets, because de_sh maps FLIK to both flik and id.

CI stays red until #246, #244 and #241 land — the sweeps run over every converter, and those three still fail on main. That ordering is the point.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DVx9uQV2QPM8ecPAY3ZjXG

@ivorbosloper
ivorbosloper force-pushed the split/base-identity branch 2 times, most recently from a2e433c to d47e82a Compare September 12, 2026 12:55
@ivorbosloper ivorbosloper changed the title FiboaBaseConverter: make id mean something, and refuse a silent variant trap FiboaBaseConverter: make id mean something Sep 12, 2026
…iant trap

Four rules, each of which was broken somewhere in the catalog without anything
noticing.

**A converter must map something to `id`.** Nothing downstream enforced it: the
base converter drops columns no mapping names, so a converter without one wrote
a file with no identifier and it validated. That is how de_bb and de_nds reached
the catalog. sk shows the subtler half — `index_as_id = True` fills the column
and the same drop step removes it again, because `columns` never named it.

**The column must be in the source, not only in the mapping.** si's 2019
campaign names the field POLJINA_ID where every later one names it ID, so the
drop step wrote 820,151 fields with no id — and that validated too.

**The values must be unique.** An audit found 36 published collections whose
latest edition repeats an id, and the catalog documents `id` as unique within an
edition. es_cl gave 9,109,136 fields the id "0"; us_usda_cropland gave 3,093
distinct ids to 7.5 million fields. The check runs before geometries are
exploded, so it judges what the converter assigned rather than the parts of a
split feature, and it ignores rows with no id at all, which the bounded drop
removes a few lines later.

**A converter may not declare both `sources` and `variants`.** `sources` wins in
the base converter and the variants are ignored entirely, so `--variant 2011`
silently converts whatever `sources` points at: hr would have published thirteen
copies of the current file as thirteen years. A converter that inherits variants
it does not want says so with `variants = {}`, as ec_be_vlg now does.

Three sweep tests run all four rules over every converter in the repository.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DVx9uQV2QPM8ecPAY3ZjXG
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