Repository navigation
fix(wqp): send a boolean as yes or no - #477
Merged
Merged
Conversation
Since DOI-USGS#473, a boolean passed to a wqp getter reaches the request as true/false. The legacy /data/ interface rejects that with HTTP 400, so wqp.what_sites(sorted=False) now fails where it used to drop the value. Both interfaces accept yes/no (checked live: sorted=no and zip=yes return 200 on legacy, sorted=false and zip=true return 400). The NEWS entry for DOI-USGS#473 is corrected in place, since it is unreleased: it names the yes/no form and notes that other non-list values are now sent as str(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NEWS.md: kept main's 11/21 get_ratings entry and this branch's reworded 11/20 entry (yes/no boolean).
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.
Follow-up to #473.
Summary
#473 sends numbers and booleans that were dropped before. A boolean reaches a
wqprequest astrueorfalse, which the legacy/data/interface rejects with HTTP 400. Sowqp.what_sites(sorted=False)now fails, where before #473 the value was dropped and the call worked. Both interfaces acceptyesandno.The metadata still records the arguments as passed. The NEWS entry for #473 is corrected in place, since it is unreleased.
Evidence
/data/Station/search?...&sorted=falseandzip=truereturn HTTP 400.After:
sorted=noandzip=yesreturn 200. Live,what_sites(sorted=False)returns rows on the legacy and WQX3 interfaces, andwhat_sites(lat=43.09, long=-89.4, within=5)returns 708 rows.test_what_sites_sends_numbers_and_booleans_as_wqp_spells_them, run withlegacy=Trueandlegacy=False, assertslat=44.2,within=2.5andsorted=noin the request.tests/wqp_test.pyandtests/utils_test.pypass (102 tests), as do mypy and the pre-commit hooks.Merge Danger
Door: two-way
Blast Radius: small
A boolean passed to a
wqpgetter is sent asyesorno.utils.query()keeps #473'strueandfalse.🤖 Generated with Claude Code