Skip to content

chore(data): drop unattributed alternate IDs from the ingested San Acacia wells - #857

Merged
jirhiker merged 1 commit into
stagingfrom
chore/drop-unknown-alternate-ids
Aug 19, 2026
Merged

chore(data): drop unattributed alternate IDs from the ingested San Acacia wells#857
jirhiker merged 1 commit into
stagingfrom
chore/drop-unknown-alternate-ids

Conversation

@jirhiker

Copy link
Copy Markdown
Member

Data migration 20260819_0001_drop_unknown_alternate_ids.

Each of the 38 San Acacia wells this pipeline reads carries two identifier
links: an NMBGMR one and an Unknown one with no recorded provenance. Mostly
they duplicate. Sometimes they contradict:

Well NMBGMR Unknown
SO-0131 BRN-E04B (shallow) BRN-E04A
SO-0132 BRN-E04A (deep) BRN-E04B

The two sources disagree about which physical well is which (BDMS-1168).
Removing the unattributed rows leaves NMBGMR as the single answer — an
identifier nobody can source is worse than none, because it reads as
corroboration.

Scope: the 38 ingested wells, deliberately

candidate scope Unknown links
the 38 ingested wells 38
SO-0125–SO-0277 reach network 152
all SO- wells 263

Widening is a separate decision, and not a neutral one: 19 of the reach
network's 152 links are the conflicting ones BDMS-1168 is tracking. Deleting
those removes the evidence along with the conflict. The other 133 are
byte-identical duplicates.

Note the database also has a group literally named "San Acacia" — 42
different wells, SAC- prefixed, of which none are the Diver-HUB points.
Worth knowing before anyone scopes future work by that name.

Safety

  • Matched by name, not id, so the migration means the same thing in every
    environment. A well missing by name is reported rather than passed over.
  • Only alternate_organization = 'Unknown' is touched. NMBGMR, PLSS, NMOSE,
    USGS, NMED and TWDB links are untouched.
  • Verified against staging: 38 wells matched, each with exactly one NMBGMR and
    one Unknown link. Removes 38 rows, leaves all 38 NMBGMR identifiers.
  • Registered against alembic revision b2c3d4e5f6a7, not repeatable.

Reminder

Data migrations have no CD path — this will sit unapplied until run by hand.

🤖 Generated with Claude Code

…acia wells

Each of the 38 wells this pipeline reads carries two identifier links: an
NMBGMR one and an "Unknown" one with no recorded provenance. Mostly they
duplicate. Sometimes they contradict -- SO-0131 has NMBGMR "BRN-E04B (shallow)"
against Unknown "BRN-E04A" while SO-0132 has them reversed, so the two sources
disagree about which physical well is which (BDMS-1168).

Removing the unattributed rows leaves NMBGMR as the single answer. An
identifier nobody can source is worse than none, because it reads as
corroboration.

Scoped to the 38 ingested wells deliberately. The wider reach network has 152
such links and every SO- well has 263; widening is a separate decision, and 19
of the reach network's links are the conflicting ones BDMS-1168 tracks --
deleting those would remove the evidence along with the conflict.

Wells are matched by name rather than id so the migration means the same thing
in every environment, and a well missing by name is reported rather than passed
over silently.

Verified against staging: 38 wells matched, each with one NMBGMR and one
Unknown link, so it removes 38 rows and leaves every NMBGMR identifier intact.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Coverage

77.96% total — gate is 75%.

Coverage for the Python files changed in this PR
Name Stmts Miss Cover Missing
data_migrations/migrations/20260819_0001_drop_unknown_alternate_ids.py 17 17 0% 41-121
TOTAL 17 17 0%

@jirhiker
jirhiker merged commit 44d7117 into staging Aug 19, 2026
9 checks passed
@jirhiker
jirhiker deleted the chore/drop-unknown-alternate-ids branch August 19, 2026 18:28
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