Skip to content

fix(waterdata): send the qualifier filter as a JSON array - #427

Merged
thodson-usgs merged 1 commit into
DOI-USGS:mainfrom
thodson-usgs:fix/qualifier-json-array
Oct 2, 2026
Merged

thodson-usgs merged 1 commit into
DOI-USGS:mainfrom
thodson-usgs:fix/qualifier-json-array

Conversation

@thodson-usgs

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

Copy link
Copy Markdown
Collaborator

TL;DR: The service parses qualifier as a JSON array, so it responded with HTTP 400 to every value the Water Data getters sent. The getters now send "ICE" as ["ICE"] and a list as one array; the service matches the whole list, in order, and the docstrings now state this. The maintainer should confirm the exact-match behavior and make four edits when rebasing after #425.

Merge order is in #426.

Changes

  • _get_args (waterdata/utils.py) encodes qualifier as one compact JSON array, from a named parameter or from **queryables (get_peaks). A string that starts with [ is sent unchanged; an empty list is still dropped.
  • qualifier docstrings on the five getters that name it: "ICE" matches ["ICE"], not ["ESTIMATED", "ICE"].

For the maintainer

Verification

🤖 Generated with Claude Code

The Water Data API parses qualifier as a JSON array, so it responded
with HTTP 400 to every value the getters sent (qualifier=ICE, or
ICE,ESTIMATED for a list). _get_args now encodes qualifier as one
compact JSON array: "ICE" becomes ["ICE"] and a list becomes one array.
This also covers qualifier passed to get_peaks through **queryables. A
string that starts with "[" is sent unchanged, and an empty list is
still dropped from the request.

The service matches the whole list, in order: "ICE" does not match an
observation qualified ["ESTIMATED", "ICE"]. It responds with 400 to the
CQL2 array operators, so there is no "contains" match; the qualifier
docstrings now state the exact-match rule.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@thodson-usgs
thodson-usgs force-pushed the fix/qualifier-json-array branch from c09fc8e to cdc358a Compare October 2, 2026 18:33
@thodson-usgs
thodson-usgs merged commit d633fb7 into DOI-USGS:main Oct 2, 2026
11 checks passed
@thodson-usgs
thodson-usgs deleted the fix/qualifier-json-array branch October 2, 2026 19:04
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.

1 participant