fix(waterdata): accept the continuous method_category queryable - #423
Draft
thodson-usgs wants to merge 1 commit into
Draft
thodson-usgs wants to merge 1 commit into
thodson-usgs wants to merge 1 commit into
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>
USGS added method_category to the continuous collection in September 2026, which failed the nightly queryables snapshot test. It is the RLMS method category code (STNRD, LMTUS, EXPER, UNKWN). It is returned on every record and is null for time series that have not been categorized. latest-continuous does not have it. - Regenerate waterdata_queryables.json and the continuous fixture. - Add method_category to get_continuous's signature, its docstring, and its list of returned columns. - Add live tests for the API version each Water Data family serves. The OGC and STAC versions are read from the self link in each root document, because OGC answers 200 for any version segment. Statistics has no root document, so the next version is probed. A second test checks that the version the package requests still returns data. 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>
This branch has not been deployed
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.
Fixes the failing nightly Live API Tests run (35698389879):
What changed upstream
USGS added
method_categoryto thecontinuouscollection: the RLMS method category code for the method in effect over an observation's interval. From the live service:continuousonly (notlatest-continuous), in both v0 and v1.UNKWNon some time series, null on others.method-categoriescollection:STNRD,LMTUS,EXPER,UNKWN.Nothing was removed or renamed.
Changes
waterdata_queryables.json(one line) and thecontinuousfixture, which now carries the field.method_categorytoget_continuous's signature, docstring and documented returned columns. It already worked through**queryables.tests/waterdata_endpoints_test.py) for the API version each Water Data family serves.endpoints.pypins versions, and nothing else notices when USGS publishes a new one because the old version keeps answering. Two tests:selflink. Probing can't be used for OGC, because it answers 200 with an empty body for any version segment, including ones that don't exist. Statistics has no root document, so it is probed; a missing statistics version returns 404._DEFAULT_VERSIONSrecordsogcapi: v1whilemainrequests v0. That is intentional: it records what the service serves, and #422 does the migration.Not in scope
get_reference_table("method-categories")is refused because that collection isn't inMETADATA_COLLECTIONS. Eight live collections are missing from the package's coverage, and this PR doesn't add any of them. The docstring lists the four codes, so the parameter can be used without the reference table.Verification
[continuous]case and the new version checks pass.🤖 Generated with Claude Code