Skip to content

fix: omit properties filter instead of requesting "id" for id/geome…#911

Merged
ldecicco-USGS merged 1 commit into
DOI-USGS:developfrom
thodson-usgs:fix/ogc-properties-id-400
Jul 7, 2026
Merged

fix: omit properties filter instead of requesting "id" for id/geome…#911
ldecicco-USGS merged 1 commit into
DOI-USGS:developfrom
thodson-usgs:fix/ogc-properties-id-400

Conversation

@ldecicco-USGS

Copy link
Copy Markdown
Collaborator

…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.

…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>
@ldecicco-USGS ldecicco-USGS merged commit 238ec0a into DOI-USGS:develop Jul 7, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants