Repository navigation
fix(waterdata): accept field-measurements sublocation_identifier - #436
Merged
thodson-usgs merged 1 commit intoOct 7, 2026
Conversation
thodson-usgs
force-pushed
the
fix/field-measurements-sublocation-identifier
branch
from
October 3, 2026 12:55
f2806d7 to
75bcad3
Compare
thodson-usgs
commented
Oct 3, 2026
thodson-usgs
force-pushed
the
fix/field-measurements-sublocation-identifier
branch
from
October 3, 2026 13:03
75bcad3 to
1f7fc21
Compare
…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
force-pushed
the
fix/field-measurements-sublocation-identifier
branch
from
October 3, 2026 13:06
1f7fc21 to
4e86db6
Compare
thodson-usgs
marked this pull request as ready for review
October 3, 2026 13:07
ehinman
approved these changes
Oct 5, 2026
ehinman
left a comment
Collaborator
There was a problem hiding this comment.
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
added a commit
that referenced
this pull request
Oct 12, 2026
…arguments (#447) Follow-ups from review of #436, which is unreleased: - Move sublocation_identifier to the end of the get_field_measurements and get_field_measurements_metadata signatures. Inserted mid-signature, it shifted every later positional argument: a positional skip_geometry or properties would have been sent as a sublocation filter. - Test against real features from USGS-05435943 (Backup, HWM, Primary) and assert the values; the shared fixture's site records no sublocation, so the old test only checked a hand-added null column. - Describe the parameter in get_time_series_metadata and get_combined_metadata, and use observed values in the examples. - Date the NEWS entry by its land date (10/07), unwrap it, and note that the field already worked through **queryables. Claude-Session: https://claude.ai/code/session_01HBt3Ee7eneKtdKQWq2T3YK Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
thodson-usgs
added a commit
to thodson-usgs/dataretrieval-python
that referenced
this pull request
Oct 13, 2026
Twenty columns that the Water Data OGC collections return could be passed only through **queryables, so their getters documented neither the column nor the filter. Each is now a named parameter of the getter that returns it, documented from the collection's /schema; NEWS.md lists them. day, month and year are typed as integers, as in get_peaks. Monitoring-location attributes that every collection accepts as filters but does not return stay in **queryables. The new parameters are keyword-only, after a bare * at the end of each signature, so every parameter released in v1.4.0 keeps its position and an existing call, positional or keyword, sends the same request. sublocation_identifier (unreleased, DOI-USGS#436) moves after the * too. tests/contracts/public_api_test.py now requires each Water Data getter's positional parameters to match their v1.4.0 order, recorded in tests/data/waterdata_positional_parameters.json, and the module docstring no longer calls a reorder harmless. The properties lists of get_monitoring_locations and get_channel now include their missing columns. get_peaks' qualifier and value, and the parameter_description of get_combined_metadata and get_field_measurements_metadata, use the same wording as the other getters and the service's /schema. tests/waterdata_properties_test.py now holds one table of the eleven OGC getters by collection, and checks: - offline, that every named parameter of each getter reaches the OGC engine (derived from the signatures, so a new parameter is covered when it is added); - live, that every column a collection's /schema publishes, other than its id and geometry, is a named parameter of its getter. Run against main, this fails on exactly the 20 columns named here; - live, that the documented column lists match the schema, now for get_monitoring_locations and get_channel too. The schema's id and the name the getter returns it under are left out of both sides, and a list ends at the sentence that follows it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HBt3Ee7eneKtdKQWq2T3YK
thodson-usgs
added a commit
to thodson-usgs/dataretrieval-python
that referenced
this pull request
Oct 13, 2026
Twenty columns that the Water Data OGC collections return could be passed only through **queryables, so their getters documented neither the column nor the filter. Each is now a named parameter of the getter that returns it, documented from the collection's /schema; NEWS.md lists them. day, month and year are typed as integers, as in get_peaks. Monitoring-location attributes that every collection accepts as filters but does not return stay in **queryables. The new parameters are keyword-only, after a bare * at the end of each signature, so every parameter released in v1.4.0 keeps its position and an existing call, positional or keyword, sends the same request. sublocation_identifier (unreleased, DOI-USGS#436) moves after the * too, and so do statistics_begin (DOI-USGS#422) and method_category (DOI-USGS#423). Those two shipped mid-signature in v1.4.0 eleven days ago; moving them shifts the later positional parameters of get_time_series_metadata and get_continuous by one, which NEWS marks as a behavior change. tests/contracts/public_api_test.py now requires each Water Data getter's positional parameters to match their v1.4.0 order (less those two), recorded in tests/data/waterdata_positional_parameters.json, and the module docstring no longer calls a reorder harmless. The properties lists of get_monitoring_locations and get_channel now include their missing columns. get_peaks' qualifier and value, and the parameter_description of get_combined_metadata and get_field_measurements_metadata, use the same wording as the other getters and the service's /schema. tests/waterdata_properties_test.py now holds one table of the eleven OGC getters by collection, and checks: - offline, that every named parameter of each getter reaches the OGC engine (derived from the signatures, so a new parameter is covered when it is added); - live, that every column a collection's /schema publishes, other than its id and geometry, is a named parameter of its getter. Run against main, this fails on exactly the 20 columns named here; - live, that the documented column lists match the schema, now for get_monitoring_locations and get_channel too. The schema's id and the name the getter returns it under are left out of both sides, and a list ends at the sentence that follows it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HBt3Ee7eneKtdKQWq2T3YK
thodson-usgs
added a commit
to thodson-usgs/dataretrieval-python
that referenced
this pull request
Oct 13, 2026
Twenty columns that the Water Data OGC collections return could be passed only through **queryables, so their getters documented neither the column nor the filter. Each is now a named parameter of the getter that returns it, documented from the collection's /schema; NEWS.md lists them. day, month and year are typed as integers, as in get_peaks. Monitoring-location attributes that every collection accepts as filters but does not return stay in **queryables. The new parameters are keyword-only, after a bare * at the end of each signature, so every parameter released in v1.4.0 keeps its position and an existing call, positional or keyword, sends the same request. sublocation_identifier (unreleased, DOI-USGS#436) moves after the * too, and so do statistics_begin (DOI-USGS#422) and method_category (DOI-USGS#423). Those two shipped mid-signature in v1.4.0 eleven days ago; moving them shifts the later positional parameters of get_time_series_metadata and get_continuous by one, which NEWS marks as a behavior change. tests/contracts/public_api_test.py now records how many parameters each Water Data getter accepts by position and fails if that changes, and its module docstring no longer calls a reorder harmless. The properties lists of get_monitoring_locations and get_channel now include their missing columns. get_peaks' qualifier and value, and the parameter_description of get_combined_metadata and get_field_measurements_metadata, use the same wording as the other getters and the service's /schema. tests/waterdata_properties_test.py now holds one table of the eleven OGC getters by collection, and checks: - offline, that every named parameter of each getter reaches the OGC engine (derived from the signatures, so a new parameter is covered when it is added); - live, that every column a collection's /schema publishes, other than its id and geometry, is a named parameter of its getter. Run against main, this fails on exactly the 20 columns named here; - live, that the documented column lists match the schema, now for get_monitoring_locations and get_channel too. The schema's id and the name the getter returns it under are left out of both sides, and a list ends at the sentence that follows it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HBt3Ee7eneKtdKQWq2T3YK
thodson-usgs
added a commit
that referenced
this pull request
Oct 13, 2026
Twenty columns that the Water Data OGC collections return could be passed only through **queryables, so their getters documented neither the column nor the filter. Each is now a named parameter of the getter that returns it, documented from the collection's /schema; NEWS.md lists them. day, month and year are typed as integers, as in get_peaks. Monitoring-location attributes that every collection accepts as filters but does not return stay in **queryables. The new parameters are keyword-only, after a bare * at the end of each signature, so every parameter released in v1.4.0 keeps its position and an existing call, positional or keyword, sends the same request. sublocation_identifier (unreleased, #436) moves after the * too, and so do statistics_begin (#422) and method_category (#423). Those two shipped mid-signature in v1.4.0 eleven days ago; moving them shifts the later positional parameters of get_time_series_metadata and get_continuous by one, which NEWS marks as a behavior change. tests/contracts/public_api_test.py now records how many parameters each Water Data getter accepts by position and fails if that changes, and its module docstring no longer calls a reorder harmless. The properties lists of get_monitoring_locations and get_channel now include their missing columns. get_peaks' qualifier and value, and the parameter_description of get_combined_metadata and get_field_measurements_metadata, use the same wording as the other getters and the service's /schema. tests/waterdata_properties_test.py now holds one table of the eleven OGC getters by collection, and checks: - offline, that every named parameter of each getter reaches the OGC engine (derived from the signatures, so a new parameter is covered when it is added); - live, that every column a collection's /schema publishes, other than its id and geometry, is a named parameter of its getter. Run against main, this fails on exactly the 20 columns named here; - live, that the documented column lists match the schema, now for get_monitoring_locations and get_channel too. The schema's id and the name the getter returns it under are left out of both sides, and a list ends at the sentence that follows it. Claude-Session: https://claude.ai/code/session_01HBt3Ee7eneKtdKQWq2T3YK Co-authored-by: Claude Opus 5.5 (1M context) <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.
Summary
The scheduled live-API run 37105829876 failed in
test_queryables_match_snapshotforfield-measurementsandfield-measurements-metadata: USGS added asublocation_identifierqueryable to both collections. It appeared onfield-measurements-metadataby the 09/30 run and onfield-measurementsby the 10/03 run. No other collection's queryables changed.Following the pattern of #423 (
method_category):tests/data/waterdata_queryables.jsonwith the script inwaterdata_queryables_test.py. The only change is the twosublocation_identifierentries.sublocation_identifieras a named, documented parameter onget_field_measurements()andget_field_measurements_metadata(). Before this, it could only be passed through**queryables.null, which is what the live service returns for those USGS-05427718 records.The live
field-measurements-metadatafailure in the 09/30–10/02 runs was the same cause. Those runs also had thecontinuousfailure 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.sublocation_identifier="UPSTREAM". Each returned onlyUPSTREAMrows.