fix(waterdata): send the qualifier filter as a JSON array - #427
Merged
Merged
Conversation
This was referenced Sep 29, 2026
thodson-usgs
force-pushed
the
fix/qualifier-json-array
branch
from
September 29, 2026 15:06
c14609b to
9b25bce
Compare
thodson-usgs
marked this pull request as ready for review
September 29, 2026 15:12
thodson-usgs
force-pushed
the
fix/qualifier-json-array
branch
from
October 2, 2026 17:00
9b25bce to
c09fc8e
Compare
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
force-pushed
the
fix/qualifier-json-array
branch
from
October 2, 2026 18:33
c09fc8e to
cdc358a
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: The service parses
qualifieras 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) encodesqualifieras 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.qualifierdocstrings on the five getters that name it:"ICE"matches["ICE"], not["ESTIMATED", "ICE"].For the maintainer
a_contains,a_overlaps,a_equals), and this PR does not filter on the client. Before this change the service responded with 400 to any list, so no working call changes meaning.NEWS.mdandget_continuousdocstring conflicts; (2) add the exact-match sentence to feat(waterdata): name every column the OGC collections return #425'sget_peaksqualifierdocstring; (3) dropqualifierfrom feat(waterdata): name every column the OGC collections return #425's_NEWLY_NAMEDtable, whose plain-value assertion no longer holds; (4) inNEWS.md, writeget_peaks()instead of "through**queryables".NEWS.mddate (09/29/2026) to the merge date.Verification
get_dailyat USGS-05420500, winter 2022–23:qualifier="ESTIMATED"returns 4 rows,["ESTIMATED", "ICE"]11,["ICE", "ESTIMATED"]0;get_peaks(qualifier="DIFFDATUM")returns 1. Onmainall four respond with 400. The new live test passes. The 400 was found by the 2026-09-29 live differential test ofmainagainst the feat(waterdata): request v1 of the Water Data API, pinnable through api_version #422–feat(waterdata): name every column the OGC collections return #425 stack.🤖 Generated with Claude Code