Skip to content

fix(waterdata): accept field-measurements sublocation_identifier - #436

Merged
thodson-usgs merged 1 commit into
DOI-USGS:mainfrom
thodson-usgs:fix/field-measurements-sublocation-identifier
Oct 7, 2026
Merged

thodson-usgs merged 1 commit into
DOI-USGS:mainfrom
thodson-usgs:fix/field-measurements-sublocation-identifier

Conversation

@thodson-usgs

Copy link
Copy Markdown
Collaborator

Summary

The scheduled live-API run 37105829876 failed in test_queryables_match_snapshot for field-measurements and field-measurements-metadata: USGS added a sublocation_identifier queryable to both collections. It appeared on field-measurements-metadata by the 09/30 run and on field-measurements by the 10/03 run. No other collection's queryables changed.

Following the pattern of #423 (method_category):

  • Regenerate tests/data/waterdata_queryables.json with the script in waterdata_queryables_test.py. The only change is the two sublocation_identifier entries.
  • Add sublocation_identifier as a named, documented parameter on get_field_measurements() and get_field_measurements_metadata(). Before this, it could only be passed through **queryables.
  • Add the field to the two OGC fixtures as null, which is what the live service returns for those USGS-05427718 records.
  • Add one offline test per getter checking that the parameter is sent as a filter and comes back as a column.
  • Add a NEWS entry.

The live field-measurements-metadata failure in the 09/30–10/02 runs was the same cause. Those runs also had the continuous failure that #423 fixed.

Testing

  • pytest tests/ (offline): 1242 passed. Coverage is 98.96%, and the ratchet holds.
  • pytest -m live tests/waterdata_queryables_test.py::test_queryables_match_snapshot: 11 passed.
  • I ran both getters against the live service with sublocation_identifier="UPSTREAM". Each returned only UPSTREAM rows.
  • ruff, mypy, lint-imports, xenon, and complexipy pass (pre-commit).

@thodson-usgs
thodson-usgs force-pushed the fix/field-measurements-sublocation-identifier branch from f2806d7 to 75bcad3 Compare October 3, 2026 12:55
Comment thread tests/waterdata_test.py Outdated
@thodson-usgs
thodson-usgs force-pushed the fix/field-measurements-sublocation-identifier branch from 75bcad3 to 1f7fc21 Compare October 3, 2026 13:03
…queryable

USGS added sublocation_identifier to the field-measurements and
field-measurements-metadata collections at the end of September 2026,
which failed the live queryables snapshot monitor. Regenerate the
snapshot, and add sublocation_identifier as a named, documented
parameter on get_field_measurements and get_field_measurements_metadata.
@thodson-usgs
thodson-usgs force-pushed the fix/field-measurements-sublocation-identifier branch from 1f7fc21 to 4e86db6 Compare October 3, 2026 13:06
@thodson-usgs
thodson-usgs requested a review from ehinman October 3, 2026 13:07
@thodson-usgs
thodson-usgs marked this pull request as ready for review October 3, 2026 13:07

@ehinman ehinman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. I'm struggling to find a monitoring location in the field measurements/field metadata endpoints that has a non-NA sublocation identifier populated, but I passed sublocation_identifier=None to get_field_measurements() and it returned all rows. Thanks for adding this.

@thodson-usgs
thodson-usgs merged commit 26f147e into DOI-USGS:main Oct 7, 2026
11 checks passed
@thodson-usgs
thodson-usgs deleted the fix/field-measurements-sublocation-identifier branch October 7, 2026 13:08
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