Skip to content

feat(waterdata): name every column the OGC collections return - #425

Open
thodson-usgs wants to merge 2 commits into
DOI-USGS:mainfrom
thodson-usgs:feat/expose-returned-columns
Open

thodson-usgs wants to merge 2 commits into
DOI-USGS:mainfrom
thodson-usgs:feat/expose-returned-columns

Conversation

@thodson-usgs

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

Copy link
Copy Markdown
Collaborator

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 to get_peaks(qualifier=...), as it does to qualifier passed 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

Getter Added
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
  • Descriptions are adapted from each collection's /schema. day, month and year are typed int | list[int], as in get_peaks.
  • The properties lists of get_monitoring_locations and get_channel add their missing columns. get_monitoring_locations joins the documented-columns monitor; get_channel stays out because its list names the output column channel_measurements_id where the schema has id.

For the maintainer

Verification

  • Offline: 1214 passed, 23 deselected, coverage 98.94%. ruff, mypy, lint-imports, complexipy and xenon pass.
  • Rerunning the /schema-to-signature comparison finds no unnamed returned column in the eleven collections.
  • Live: filtering on a value taken from a response returned only matching rows for measurement_rated, reading_type, control_condition and parameter_description.
  • Live: documented-columns monitor (tests/waterdata_properties_test.py) with monitoring-locations added, 6 passed (2026-09-29).

🤖 Generated with Claude Code

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

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.

@thodson-usgs

Copy link
Copy Markdown
Collaborator Author

There's a lot of redundancy in these PRs.

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.

@thodson-usgs
thodson-usgs force-pushed the feat/expose-returned-columns branch from 908e741 to db190a9 Compare October 2, 2026 17:00
thodson-usgs and others added 2 commits October 2, 2026 13:32
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>
@thodson-usgs
thodson-usgs force-pushed the feat/expose-returned-columns branch from db190a9 to 53a6970 Compare October 2, 2026 18:33

This branch has not been deployed

No deployments
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