Skip to content

fix(waterdata): accept the continuous method_category queryable - #423

Merged
thodson-usgs merged 1 commit into
DOI-USGS:mainfrom
thodson-usgs:fix/continuous-method-category
Oct 2, 2026
Merged

thodson-usgs merged 1 commit into
DOI-USGS:mainfrom
thodson-usgs:fix/continuous-method-category

Conversation

@thodson-usgs

@thodson-usgs thodson-usgs commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

TL;DR: USGS added method_category to the continuous collection, which made the nightly live run fail (35698389879). This PR adds it to get_continuous as 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 with 6121a965 rebased onto main.

Merge order is in #426.

Changes

  • get_continuous takes method_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 in continuous only, in v0 and v1, is returned on every record (UNKWN on some time series, null on others), and is accepted as a filter. The continuous fixture is regenerated.
  • The main-based branch (6a146f78) also adds method_category to tests/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.
  • New live monitor, tests/waterdata_endpoints_test.py: each family's default version must be the one waterdata/endpoints.py requests, 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

  • The monitor fails the nightly run whenever a family's default version differs from the pin in waterdata/endpoints.py, until the pin is moved. Confirm this is the intended signal.
  • get_reference_table("method-categories") is still refused, because method-categories is not in METADATA_COLLECTIONS; the docstring lists the four codes.
  • After feat(waterdata): request v1 of the Water Data API, pinnable through api_version #422 merges, replace this branch with 6121a965 rebased onto main, and set the NEWS.md date (09/22/2026) to the merge date.

Verification

🤖 Generated with Claude Code

@thodson-usgs
thodson-usgs force-pushed the fix/continuous-method-category branch from 0620c66 to 42b53d2 Compare September 23, 2026 02:32
@thodson-usgs thodson-usgs changed the title fix(waterdata): accept the new continuous method_category queryable fix(waterdata): accept the continuous method_category queryable Sep 23, 2026
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
thodson-usgs force-pushed the fix/continuous-method-category branch from 42b53d2 to c3feaca Compare September 24, 2026 14:29
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>
@thodson-usgs
thodson-usgs force-pushed the fix/continuous-method-category branch from c3feaca to 1460ecd Compare September 29, 2026 13:01
@thodson-usgs
thodson-usgs force-pushed the fix/continuous-method-category branch from 1460ecd to 6a146f7 Compare September 29, 2026 15:06
@thodson-usgs
thodson-usgs marked this pull request as ready for review September 29, 2026 15:12

@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.

One suggested language edit, otherwise approved.

Comment thread NEWS.md
@@ -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.

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.

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
thodson-usgs force-pushed the fix/continuous-method-category branch from 6a146f7 to 1f1ec09 Compare October 2, 2026 17:00
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
thodson-usgs force-pushed the fix/continuous-method-category branch from 1f1ec09 to 3af4af5 Compare October 2, 2026 17:17
@thodson-usgs
thodson-usgs merged commit ca6a439 into DOI-USGS:main Oct 2, 2026
11 checks passed
@thodson-usgs
thodson-usgs deleted the fix/continuous-method-category branch October 2, 2026 18:51
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