Use GET with comma-separated values for multi-value waterdata queries#233
Draft
thodson-usgs wants to merge 1 commit intoDOI-USGS:mainfrom
Draft
Use GET with comma-separated values for multi-value waterdata queries#233thodson-usgs wants to merge 1 commit intoDOI-USGS:mainfrom
thodson-usgs wants to merge 1 commit intoDOI-USGS:mainfrom
Conversation
The OGC API now supports comma-separated values for fields like monitoring_location_id, parameter_code, and statistic_id, making POST+CQL2 unnecessary for most services. Update _construct_api_requests to join list params with commas and use GET for daily, continuous, latest-daily, latest-continuous, field-measurements, time-series-metadata, and channel-measurements. The monitoring-locations endpoint does not yet support comma-separated GET parameters (returns 400); it retains the POST+CQL2 path. Closes DOI-USGS#210. Co-Authored-By: Claude Sonnet 4.6 <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.
Closes #210
Summary
The OGC API now supports comma-separated multi-value parameters for fields like
monitoring_location_id,parameter_code, andstatistic_id(e.g.parameter_code=00060,00010). This means the CQL2 POST path is no longer needed for most services._construct_api_requestsnow:API limitation to note upstream
During development we found that the
monitoring-locationscollection endpoint returns HTTP 400 for comma-separated values (e.g.hydrologic_unit_code=010802050102,010802050103or evenmonitoring_location_id=USGS-A,USGS-B). The POST+CQL2 path is preserved for this service. This may be a gap in the upstream API that could be enabled field-by-field — if the Water Data APIs team enables split-parameter support formonitoring-locations, the_cql2_required_servicesset in this code can be emptied and the POST branch removed entirely.Test plan
test_construct_api_requests_multivalue_get: verifies GET method and comma-encoded URL fordailywith multiplemonitoring_location_id/parameter_codevaluestest_construct_api_requests_monitoring_locations_post: verifies POST+CQL2 is still used formonitoring-locationstest_get_monitoring_locations_hucs,test_get_latest_continuous,test_get_latest_daily,test_get_daily, etc.)🤖 Generated with Claude Code