fix(waterdata): accept the continuous method_category queryable - #423
Merged
thodson-usgs merged 1 commit intoOct 2, 2026
Merged
Conversation
This was referenced Sep 22, 2026
thodson-usgs
force-pushed
the
fix/continuous-method-category
branch
from
September 23, 2026 02:32
0620c66 to
42b53d2
Compare
thodson-usgs
added a commit
to thodson-usgs/dataretrieval-python
that referenced
this pull request
Sep 23, 2026
Comparing each collection's /schema with its getter's signature found 20 returned columns that were reachable only through **queryables, so the getter documented neither the column nor the filter: - get_field_measurements: control_condition, day, field_measurements_series_id, measurement_rated, month, reading_type, time_of_day, year - get_peaks: qualifier, time_of_day, value - get_monitoring_locations: revision_created, revision_modified, revision_note - get_combined_metadata: data_gap_interval, reading_type - get_time_series_metadata: data_gap_interval, parameter_description - get_field_measurements_metadata: reading_type - get_channel: channel_location_direction Each is now a named parameter, described in the service's own words. day, month and year take the integer annotation get_peaks already uses. The monitoring-location attributes every collection accepts as filters but does not return stay in **queryables. Existing calls send the same request as before. Stacked: this commit also carries DOI-USGS#422 (Water Data API v1), DOI-USGS#423 (continuous method_category and the API-version monitor) and DOI-USGS#424 (the documented-columns monitor), which merge first. 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
Sep 23, 2026
get_daily, get_continuous and get_time_series_metadata list their returned columns in the properties docstring. The list is hand-written and went stale twice without anything noticing: continuous was missing method_category (DOI-USGS#423) and time-series-metadata data_gap_interval (DOI-USGS#422). Add a live test that compares each list with the collection's /schema and names the docstring to edit when they differ. id is excluded on both sides because only time-series-metadata lists it in its schema, though all three accept it. Stacked: this commit also carries DOI-USGS#422 (Water Data API v1) and DOI-USGS#423 (continuous method_category and the API-version monitor), which merge first. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
thodson-usgs
force-pushed
the
fix/continuous-method-category
branch
from
September 24, 2026 14:29
42b53d2 to
c3feaca
Compare
thodson-usgs
added a commit
to thodson-usgs/dataretrieval-python
that referenced
this pull request
Sep 24, 2026
Comparing each collection's /schema with its getter's signature found 20 returned columns that could be passed only through **queryables, so the getter documented neither the column nor the filter: - get_field_measurements: control_condition, day, field_measurements_series_id, measurement_rated, month, reading_type, time_of_day, year - get_peaks: qualifier, time_of_day, value - get_monitoring_locations: revision_created, revision_modified, revision_note - get_combined_metadata: data_gap_interval, reading_type - get_time_series_metadata: data_gap_interval, parameter_description - get_field_measurements_metadata: reading_type - get_channel: channel_location_direction Each is now a named parameter, described in the service's own words. day, month and year are typed as integers, as get_peaks already types them. The monitoring-location attributes that every collection accepts as filters but does not return stay in **queryables. Existing calls send the same request as before. Stacked on DOI-USGS#422, DOI-USGS#423 and DOI-USGS#424, which merge first; review this commit alone. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
5 tasks
thodson-usgs
force-pushed
the
fix/continuous-method-category
branch
from
September 29, 2026 13:01
c3feaca to
1460ecd
Compare
This was referenced Sep 29, 2026
thodson-usgs
force-pushed
the
fix/continuous-method-category
branch
from
September 29, 2026 15:06
1460ecd to
6a146f7
Compare
thodson-usgs
marked this pull request as ready for review
September 29, 2026 15:12
ehinman
approved these changes
Oct 1, 2026
ehinman
left a comment
Collaborator
There was a problem hiding this comment.
One suggested language edit, otherwise approved.
| @@ -1,3 +1,5 @@ | |||
| **09/22/2026:** `waterdata.get_continuous()` accepts `method_category`, a column USGS added to the `continuous` collection in September 2026: the RLMS method category code (`STNRD`, `LMTUS`, `EXPER` or `UNKWN`) for the method in effect over an observation's interval. It is returned on every record and is null for time series that have not been categorized. It could already be passed through `**queryables`; it is now a documented parameter. `get_latest_continuous()` is unchanged, because `latest-continuous` does not have the field. | |||
Collaborator
There was a problem hiding this comment.
Suggested change
| **09/22/2026:** `waterdata.get_continuous()` accepts `method_category`, a column USGS added to the `continuous` collection in September 2026: the RLMS method category code (`STNRD`, `LMTUS`, `EXPER` or `UNKWN`) for the method in effect over an observation's interval. It is returned on every record and is null for time series that have not been categorized. It could already be passed through `**queryables`; it is now a documented parameter. `get_latest_continuous()` is unchanged, because `latest-continuous` does not have the field. | |
| **09/22/2026:** `waterdata.get_continuous()` accepts `method_category`, a column USGS added to the `continuous` collection in September 2026: the RLMS method category code (`STNRD`, `LMTUS`, `EXPER` or `UNKWN`) for the method in effect over an observation's interval. It is returned on every record and is null for time series that have not been categorized. `method_category` was already available in the `**queryables` endpoint, but it is now a documented parameter. `get_latest_continuous()` is unchanged, because `latest-continuous` does not have the field. |
thodson-usgs
force-pushed
the
fix/continuous-method-category
branch
from
October 2, 2026 17:00
6a146f7 to
1f1ec09
Compare
USGS added method_category to the continuous collection in September 2026. get_continuous now takes it as a named parameter and documents it as a returned column. Add live tests that each Water Data family's default API version matches the one waterdata/endpoints.py requests.
thodson-usgs
force-pushed
the
fix/continuous-method-category
branch
from
October 2, 2026 17:17
1f1ec09 to
3af4af5
Compare
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.
TL;DR: USGS added
method_categoryto thecontinuouscollection, which made the nightly live run fail (35698389879). This PR adds it toget_continuousas a named parameter, and adds a live monitor that fails when a Water Data family's default API version differs from the one the package requests. The maintainer should confirm that failure policy and, after #422 merges, replace this branch with6121a965rebased ontomain.Merge order is in #426.
Changes
get_continuoustakesmethod_category, the RLMS method category code (STNRD,LMTUS,EXPER,UNKWN), as a named parameter and lists it among the returned columns; it was already accepted through**queryables. Measured live, the field is incontinuousonly, in v0 and v1, is returned on every record (UNKWNon some time series, null on others), and is accepted as a filter. Thecontinuousfixture is regenerated.main-based branch (6a146f78) also addsmethod_categorytotests/data/waterdata_queryables.json. The copy on top of feat(waterdata): request v1 of the Water Data API, pinnable through api_version #422 (6121a965) does not, because feat(waterdata): request v1 of the Water Data API, pinnable through api_version #422's v1 snapshot already lists it; the copies are otherwise identical.tests/waterdata_endpoints_test.py: each family's default version must be the onewaterdata/endpoints.pyrequests, and the requested version must still return data. No other test fails when USGS changes the default, because the old version keeps responding.For the maintainer
waterdata/endpoints.py, until the pin is moved. Confirm this is the intended signal.get_reference_table("method-categories")is still refused, becausemethod-categoriesis not inMETADATA_COLLECTIONS; the docstring lists the four codes.6121a965rebased ontomain, and set theNEWS.mddate (09/22/2026) to the merge date.Verification
6121a9651193 passed, 17 deselected, branch coverage 98.95% (ratchet 98.9);6a146f781178 passed. ruff,mypy --strict, lint-imports, xenon and complexipy pass.tests/waterdata_endpoints_test.py5 passed, and the[continuous]queryables case that failed the nightly run passes. On6a146f78theogcapidefault-version case fails, becausemainrequests OGC v0 and the service serves v1; this is intended and passes once feat(waterdata): request v1 of the Water Data API, pinnable through api_version #422 merges.🤖 Generated with Claude Code