Fix WQX3 array parameter serialization - #390
Open
thodson-usgs wants to merge 2 commits into
Open
Conversation
The array-parameter fix derived the WQX3-vs-legacy decision a second time at each call site to pick a delimiter, in opposite polarity from the branch that had already picked the URL. Set both together instead, so the "wqx3_url implies repeated params" invariant reads off one branch per arm. _what drops use_wqx3 and its duplicate services_wqx3 membership test for a flat three-way branch; the stack depth to _legacy_only_url is unchanged, so the hand-tuned stacklevel in _warn_wqx3_unavailable still lands. _query_with_retry now builds a new payload rather than writing joined values back into the caller's dict. The legacy path previously mutated the caller's kwargs -- storing None for scalars -- while the new WQX3 path did not, so WQP_Metadata saw different parameters depending on the interface. Live WQX3 checks confirm semicolon lists are wrong for every array parameter tested, not just siteType: huc, organization, providers, siteid, countycode, statecode, sampleMedia, characteristicType, characteristicName, pCode and countrycode all return correct unions only with repeated keys. The tests' "River/Stream" example is a WQX3 Location_Type response value, not a valid siteType filter term -- the live service rejects it -- so the examples now use Stream/Well. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
thodson-usgs
marked this pull request as ready for review
August 25, 2026 18:51
Collaborator
Author
|
@ehinman, revise as you see fit and merge. I don't need to review this one. |
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.
Summary
Validation
pytest -q tests/wqp_test.py(34 passed)coverage run -m pytest tests/ && coverage report -m(997 passed, 12 deselected; 98% coverage)ruff check .ruff format --check .mypyxenon --max-absolute C --max-modules B --max-average A dataretrievalcomplexipy dataretrievallint-importsFixes #389