feat(waterdata): name every column the OGC collections return - #425
thodson-usgs wants to merge 2 commits into
Conversation
55b19f8 to
9a53c12
Compare
9a53c12 to
2aa8648
Compare
2aa8648 to
908e741
Compare
ehinman
left a comment
There was a problem hiding this comment.
I think putting the new input parameters before properties makes sense. Using positional argument orders to pull data is not very robust on the user's part, so I don't see an issue with changing the positions of the arguments, if only to encourage calling out the inputs specifically.
One question, why are all these PRs merging to main as opposed to the switch to v1? There's a lot of redundancy in these PRs. I'll admit I don't quite understand what's going on with the conflicts and what not. I'll re-read the issue #426.
Yes, these build off each other. Is that what you mean? Simplest to go in order described in issue #426, and work through them one by one. Merging before moving to the next. I'll work through the first couple, then check back in. |
908e741 to
db190a9
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>
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. Keyword calls send the same request as before. The new parameters precede properties, so a positional call that passes properties or a later argument binds it to a different parameter. The properties lists of get_monitoring_locations and get_channel now include their missing columns, and get_monitoring_locations joins the documented-columns monitor in tests/waterdata_properties_test.py. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
db190a9 to
53a6970
Compare
TL;DR: Adds named, documented parameters for 20 columns that the Water Data OGC collections return and that could previously be passed only through
**queryables; keyword calls send the same request as before. Until #427 merges, the service responds with HTTP 400 toget_peaks(qualifier=...), as it does toqualifierpassed through**queryables. The maintainer should confirm the choices below, including a parameter order that changes positional calls.Stacked on #422, #423 and #424; merge order is in #426. Review only the last commit.
Changes
get_field_measurementscontrol_condition,day,field_measurements_series_id,measurement_rated,month,reading_type,time_of_day,yearget_peaksqualifier,time_of_day,valueget_monitoring_locationsrevision_created,revision_modified,revision_noteget_combined_metadatadata_gap_interval,reading_typeget_time_series_metadatadata_gap_interval,parameter_descriptionget_field_measurements_metadatareading_typeget_channelchannel_location_direction/schema.day,monthandyearare typedint | list[int], as inget_peaks.propertieslists ofget_monitoring_locationsandget_channeladd their missing columns.get_monitoring_locationsjoins the documented-columns monitor;get_channelstays out because its list names the output columnchannel_measurements_idwhere the schema hasid.For the maintainer
properties, so a positional call that passespropertiesor a later argument now binds it to a new parameter (inget_field_measurementsandget_time_series_metadata,propertieswas the fourth). Placing them after each getter's last named parameter would avoid this; feat(waterdata): request v1 of the Water Data API, pinnable through api_version #422'sstatistics_beginand fix(waterdata): accept the continuous method_category queryable #423'smethod_categoryare also inserted mid-signature.county_name,site_type, ...) that every data collection accepts as filters but does not return. They stay in**queryables.get_peaks(value=...)is typed as a string, because the service transmits peak values as strings to preserve precision.qualifieras a JSON array and, when rebased onto this PR, removesqualifierfrom_NEWLY_NAMED.NEWS.mddate (09/22/2026) to the merge date.Verification
/schema-to-signature comparison finds no unnamed returned column in the eleven collections.measurement_rated,reading_type,control_conditionandparameter_description.tests/waterdata_properties_test.py) withmonitoring-locationsadded, 6 passed (2026-09-29).🤖 Generated with Claude Code