BDMS 626: groundwater level field activity & test fixes#609
Merged
jacob-a-brown merged 9 commits intokas-well-BDMS-626-inventory-ingestion-updates_v2from Mar 18, 2026
Merged
Conversation
…nventory import This commit adds a new field activity for groundwater level measurements during the well inventory import process if an optional water level is provided. The field activity is created with the type "groundwater level" and includes notes about the measurement. This enhancement allows for better tracking of groundwater level data associated with well inventory events.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for importing optional groundwater-level measurements as part of the well-inventory CSV flow, ensuring they are recorded as their own field activity and mapping the “level_status” field onto the observation’s groundwater-level reason.
Changes:
- Create a second
FieldActivity(activity_type="groundwater level") when water-level data is present and attach the createdSampleto it. - Restrict
WellInventoryRow.level_statustoGroundwaterLevelReasonenum values and map it toObservation.groundwater_level_reason. - Update/add tests around water-level import behavior and timezone-aware datetime comparisons.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
services/well_inventory_csv.py |
Creates a groundwater-level FieldActivity, attaches Sample to it, and maps level_status onto the Observation. |
schemas/well_inventory.py |
Changes level_status to a GroundwaterLevelReason-validated field. |
tests/test_well_inventory.py |
Adds coverage for water-level rows, updates enum usage in helper tests, and adjusts datetime expectations. |
You can also share your feedback on Copilot code review. Take the survey.
ksmuczynski
requested changes
Mar 18, 2026
Contributor
ksmuczynski
left a comment
There was a problem hiding this comment.
Looking good! Codex had valid comments. I would address them, then re-request my review for approval.
If a sample is recorded use the field activity with activity type "groundwater level" instead of "well inventory", otherwise use "well inventory" for the field activity.
…se None This protects the field for when null value are submitted
ksmuczynski
approved these changes
Mar 18, 2026
Contributor
ksmuczynski
left a comment
There was a problem hiding this comment.
Looks great, approved!
6fb61cf
into
kas-well-BDMS-626-inventory-ingestion-updates_v2
5 checks passed
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.
Why
This PR addresses the following problem / context:
FieldActivityrecord should be created whereactivity_typeisgroundwater levellevel_statusshould be restricted toGroundWaterLevelReasonenum valuesHow
Implementation summary - the following was changed / added / removed:
FieldActivityrecord is created withactivity_type="groundwater level". The newly createdsamplereferences thisFieldActivityrecord instead of the one whereactivity_type="well inventory"level_statuswas restricted to theGroundWaterLevelReasonenum and mapped to thegroundwater_level_reasonfield in theObservationmodelNotes
Any special considerations, workarounds, or follow-up work to note?