Fix iterable filters for combined metadata - #393
Merged
thodson-usgs merged 3 commits intoAug 26, 2026
Merged
Conversation
thodson-usgs
marked this pull request as ready for review
August 26, 2026 13:45
…-merge # Conflicts: # AGENTS.md
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
waterdata.get_combined_metadatareturns no rows for iterable query parameters #392 as a code bug:get_combined_metadatadocuments iterable filters, but comma-joined GET values return no matches while equivalent CQL2 queries workcombined-metadatafilters through the existing CQL2 POST pathmonitoring-locationsandcombined-metadataas CQL2 exceptionsCloses #392.
Live API verification
Verified against the Water Data API on 2026-08-26 with
site_type_code,agency_code, andstate_name. Every field produced the same result:monitoring-locationscombined-metadataPR #233 recorded the historical
monitoring-locationsfailure as HTTP 400. The live endpoint now fails silently with an empty HTTP 200 response instead, but CQL2 remains necessary for correct multi-value behavior.Forced-chunk stress testing
Compared complete live result sets after sorting by record ID:
parallel_chunks(4)(4 fetches)parallel_chunks(8)(8 fetches)get_monitoring_locationspath: identical 2-record result unchunked and after eight chunksAdjacent observations were not introduced by this change:
limit=1can return overlapping pages, but the same duplicate IDs reproduce on the unchanged scalar GET path; the unique-ID set matcheslimit=50max_rowscan select a different valid subset after partitioning because the API provides no global order; complete uncapped sets matchobjectversus pandasstringunder fan-out while IDs and values remain identical; this is generic chunk-frame combination behaviorValidation
python3 -m pytest tests/waterdata_test.py -k 'combined_metadata or monitoring_locations or construct_api_requests' -q(13 passed)python3 -m pytest tests/waterdata_chunking_test.py -q(118 passed)python3 -m pytest tests/waterdata_utils_test.py -q(94 passed)python3 -m coverage run -m pytest tests/(998 passed, 12 live tests deselected)python3 -m coverage report -m(98%)python3 -m ruff check .python3 -m ruff format --check .python3 -m mypypython -m xenon --max-absolute C --max-modules B --max-average A dataretrievalcomplexipy dataretrievallint-imports(8 contracts kept)