Skip to content

fix: drop child-row release filters from NGWMN construction/lithology views#720

Merged
jirhiker merged 2 commits into
stagingfrom
fix/ngwmn-release-filters
Jun 12, 2026
Merged

fix: drop child-row release filters from NGWMN construction/lithology views#720
jirhiker merged 2 commits into
stagingfrom
fix/ngwmn-release-filters

Conversation

@jirhiker

Copy link
Copy Markdown
Member

What changed

Migration w1x2y3z4a5b6 recreates NGWMN_WellConstruction and NGWMN_Lithology without the release_status predicates on well_screen, well_casing_material, and thing_geologic_formation_association. The thing-level release_status = 'public' filter stays, and NGWMN_WaterLevels is untouched.

Why

Staging testing after #718 showed /ngwmn/lithology empty for every well and all screen/casing-description columns NULL in /ngwmn/wellconstruction. The child-row filters (added in review) assume those tables carry release statuses, but transfers never set them — every row defaults to draft: 3005/3005 well_screen, 63/63 well_casing_material, 993/993 formation associations on the transferred dataset.

Construction and lithology rows are attributes of the well; the well's own release status (genuinely managed: ~9.8k public / ~1.2k private) is the export gate. The waterlevels chain keeps its full set of filters because observation/sample/event/activity do carry real public/private values.

Testing

  • Fixtures in tests/test_ngwmn_endpoints.py now leave screen/material/association rows at draft and assert they still export when the thing is public; the private-thing test still proves a private well exports nothing.
  • Full suite: 658 passed (same 2 pre-existing test_ogc.py failures as staging).
  • Downgrade restores the filtered definitions; upgrade/downgrade cycle verified.

🤖 Generated with Claude Code

… views

The release_status predicates on well_screen, well_casing_material, and
thing_geologic_formation_association emptied the NGWMN exports on
staging: transfers never set release_status on those child tables, so
every row is 'draft' (3005/3005 screens, 63/63 casing materials,
993/993 formation associations). Construction and lithology rows are
attributes of the well, so the thing-level public filter remains the
gate; NGWMN_WaterLevels is unchanged because its field-data chain does
carry real release values.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 12, 2026 19:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes empty/NULL NGWMN construction and lithology exports by removing release_status = 'public' filtering on child tables in the NGWMN_WellConstruction and NGWMN_Lithology views, while keeping the thing.release_status = 'public' gate intact (and leaving NGWMN_WaterLevels unchanged).

Changes:

  • Recreate NGWMN_WellConstruction and NGWMN_Lithology views without child-row release_status predicates (with downgrade restoring prior behavior).
  • Update NGWMN endpoint test fixtures so child rows remain draft and are still exported when the parent thing is public.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
alembic/versions/w1x2y3z4a5b6_drop_child_release_filters_from_ngwmn_views.py Rebuilds the two NGWMN views to drop child-row release filters (upgrade) and restore them (downgrade).
tests/test_ngwmn_endpoints.py Adjusts fixture data to keep child rows in draft and validate exports are gated by the well’s release status.

Comment thread tests/test_ngwmn_endpoints.py Outdated
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jirhiker jirhiker merged commit 063c4a7 into staging Jun 12, 2026
9 checks passed
@jirhiker jirhiker deleted the fix/ngwmn-release-filters branch June 12, 2026 20:40
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.

2 participants