fix: drop child-row release filters from NGWMN construction/lithology views#720
Merged
Conversation
… 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>
Contributor
There was a problem hiding this comment.
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_WellConstructionandNGWMN_Lithologyviews without child-rowrelease_statuspredicates (with downgrade restoring prior behavior). - Update NGWMN endpoint test fixtures so child rows remain
draftand are still exported when the parentthingis 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. |
Co-Authored-By: Claude Fable 5 <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.
What changed
Migration
w1x2y3z4a5b6recreatesNGWMN_WellConstructionandNGWMN_Lithologywithout therelease_statuspredicates onwell_screen,well_casing_material, andthing_geologic_formation_association. The thing-levelrelease_status = 'public'filter stays, andNGWMN_WaterLevelsis untouched.Why
Staging testing after #718 showed
/ngwmn/lithologyempty 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 todraft: 3005/3005well_screen, 63/63well_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
tests/test_ngwmn_endpoints.pynow leave screen/material/association rows atdraftand assert they still export when the thing is public; the private-thing test still proves a private well exports nothing.test_ogc.pyfailures as staging).🤖 Generated with Claude Code