test(waterdata): assert documented columns match the collection schema - #424
Merged
thodson-usgs merged 1 commit intoOct 2, 2026
Merged
Conversation
thodson-usgs
force-pushed
the
test/documented-properties-monitor
branch
from
September 23, 2026 02:32
d72f7f4 to
55e13d4
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
force-pushed
the
test/documented-properties-monitor
branch
from
September 23, 2026 02:36
55e13d4 to
4f81930
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>
thodson-usgs
force-pushed
the
test/documented-properties-monitor
branch
from
September 24, 2026 14:29
4f81930 to
016025a
Compare
5 tasks
thodson-usgs
force-pushed
the
test/documented-properties-monitor
branch
from
September 29, 2026 13:01
016025a to
e181c46
Compare
thodson-usgs
force-pushed
the
test/documented-properties-monitor
branch
from
September 29, 2026 15:06
e181c46 to
73451c4
Compare
thodson-usgs
marked this pull request as ready for review
September 29, 2026 15:12
ehinman
approved these changes
Oct 1, 2026
thodson-usgs
force-pushed
the
test/documented-properties-monitor
branch
from
October 2, 2026 17:00
73451c4 to
0de0e92
Compare
Seven getters list their returned columns in the properties docstring. The lists are written by hand, and two went out of date without a test failing: continuous lacked method_category (DOI-USGS#423) and time-series-metadata lacked data_gap_interval (DOI-USGS#422). Add a live test that compares the lists of get_daily, get_continuous, get_latest_continuous, get_latest_daily and get_time_series_metadata with each collection's /schema; its failure message names the docstring to edit. id is excluded on both sides, because some schemas list it and some do not. get_channel and get_monitoring_locations are left out because their lists do not match /schema. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
thodson-usgs
force-pushed
the
test/documented-properties-monitor
branch
from
October 2, 2026 18:33
0de0e92 to
e370eb0
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: Adds a live test that compares the columns five Water Data getters list in their
propertiesdocstring with each collection's/schema, because two of these hand-written lists went out of date without a test failing. The maintainer should confirm the four choices below.Stacked on #422 and #423; merge order is in #426. Review only
tests/waterdata_properties_test.pyand its line intests/contracts/README.md.Changes
daily,continuous,latest-continuous,latest-dailyandtime-series-metadata. It compares the getter's "Available options are:" list with the collection's/schema, and the failure message names the docstring to edit.For the maintainer
help()or IDE tooltips.idis excluded on both sides: some schemas list it and some do not.get_latest_continuousandget_latest_dailyare included although their lists were correct, which adds two requests to the nightly run.get_channelandget_monitoring_locationsare left out because their lists do not match v1/schema. feat(waterdata): name every column the OGC collections return #425 corrects both and addsget_monitoring_locations(6 live cases);get_channelstays out because its list nameschannel_measurements_idwhere the schema hasid.Verification
main(75e56ab6), the test fails oncontinuous(nomethod_category) andtime-series-metadata(nodata_gap_interval) and passes on the other three.🤖 Generated with Claude Code