Repository navigation
Simplify WQP module to share internal functions - #394
Merged
Merged
Conversation
…of function for different services
thodson-usgs
force-pushed
the
simplify-wqp-mod
branch
from
August 26, 2026 19:22
543e768 to
2bf869b
Compare
Fold the WQX3 Result default into _PROFILE_RULES so the table is the single source of every per-service dataProfile fact, flatten the validation to one branch per fact, and rename endpoint -> service to match the vocabulary the rest of the module and its error messages use. _resolve_profile now returns the payload like its neighbour _check_kwargs rather than writing into the caller's dict behind a check-shaped name. Tests: drive the profile parametrize off activity_profiles_legacy, and replace the hand-built Activity CSV with a fixture comparison inside test_what_query so the "only Result is post-processed" guard is pinned for all eight what_* wrappers instead of one. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
thodson-usgs
approved these changes
Aug 26, 2026
thodson-usgs
left a comment
Collaborator
There was a problem hiding this comment.
The autoreview caught a glossary/adr violation and a minor bug. I went ahead and pushed the fix. Good to merge.
Both sides changed the WQP request path. upstream/main co-located the array-filter delimiter with endpoint selection (WQX3 rejects semicolon-joined values, so it repeats the key instead) and made _check_kwargs materialize iterables; this branch collapsed get_results and _what into the single _query_wqp funnel. Resolved by keeping the funnel and porting the delimiter rule into it, so the three-way endpoint branch now selects url and delimiter together: legacy-only services and legacy WQX3-capable services send ";", the WQX3 interface sends None. Verified that delimiter is None exactly when the resolved URL is a /wqx3/ one, across every service/legacy pair. Both sides' tests were added at the same anchor and are kept in full. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Drafted by Kiro. This MR allows all WQP functions to leverage the same internal function, _query_wqp, which validates service + profile, makes the API request, detects and formats datetime columns, and creates a metadata object. Reduces redundant code.