fix: omit properties filter instead of requesting "id" for id/geome…#911
Merged
ldecicco-USGS merged 1 commit intoJul 7, 2026
Merged
Conversation
…try-only calls `switch_properties_id()` strips the feature id and `geometry` from the wire `properties` (the feature id is always returned and renamed downstream; geometry is controlled by `skipGeometry`). When a user requested only the id and/or geometry, the list became empty and the function fell back to `properties <- "id"`. That fallback now fails: several collections (e.g. `daily`, `continuous`) reject `id` as a selectable property, and it also fails the available-properties check in `construct_api_requests()`, so e.g. `read_waterdata_daily(properties = "daily_id")` errors with `Invalid properties: id`. Fall back to `NA_character_` instead, which omits the `properties` filter entirely. The feature id still comes back and `rejigger_cols()` subsets the result to the requested column, so id/geometry-only requests succeed on every collection (verified live against daily, continuous, and monitoring-locations). Collections that still accept `id` (e.g. monitoring-locations) are unchanged. Adds a unit test for `switch_properties_id()` covering the id/geometry-only and mixed cases. Co-Authored-By: Claude Fable 5 <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.
…try-only calls
switch_properties_id()strips the feature id andgeometryfrom the wireproperties(the feature id is always returned and renamed downstream; geometry is controlled byskipGeometry). When a user requested only the id and/or geometry, the list became empty and the function fell back toproperties <- "id". That fallback now fails: several collections (e.g.daily,continuous) rejectidas a selectable property, and it also fails the available-properties check inconstruct_api_requests(), so e.g.read_waterdata_daily(properties = "daily_id")errors withInvalid properties: id.Fall back to
NA_character_instead, which omits thepropertiesfilter entirely. The feature id still comes back andrejigger_cols()subsets the result to the requested column, so id/geometry-only requests succeed on every collection (verified live against daily, continuous, and monitoring-locations). Collections that still acceptid(e.g. monitoring-locations) are unchanged.Adds a unit test for
switch_properties_id()covering the id/geometry-only and mixed cases.