Fix summarize_waterdata_samples doc claims that contradict the service#889
Merged
ldecicco-USGS merged 1 commit intoDOI-USGS:developfrom May 5, 2026
Merged
Conversation
The doc for `summarize_waterdata_samples` carries two claims that
contradict both the function's own behavior and the live API:
1. "Location identifiers should be separated with commas, for example:
AZ014-..., CAX01-..., USGS-..." — but the function itself rejects
multi-ID input with `if (length > 1) stop("Summary service only
available for one site at a time.")`. The summary endpoint is
path-based (`/summary/{id}`), so a comma in the input would just
become part of a single weird path segment.
2. "Location numbers without an agency prefix are assumed to have the
prefix USGS." — verified against the live API: a bare ID (e.g.
`04183500`) returns HTTP 200 with zero data rows and a different
column shape than the prefixed version (`activities` vs
`activityCount`). The auto-prefix behavior is not what the service
does.
Both claims appear to have been copy-pasted from
`construct_waterdata_sample_request`'s doc, where they may apply to
the multi-site `/results/<profile>` endpoint but do not apply to the
single-site `/summary/{id}` endpoint that this function wraps.
Replaces the two incorrect sentences with accurate single-site
guidance and notes the agency-prefix requirement.
Co-Authored-By: Claude Opus 4.7 (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.
Summary
The roxygen doc for
summarize_waterdata_samplescontains two statements that conflict with the function's own behavior and with the underlying/samples-data/summary/{id}service.Bug 1: comma-separated identifiers are not supported
Doc states:
The function rejects vectors of length > 1:
The endpoint is path-based (
/summary/{id}), so a comma-joined value would be sent as a single literal path segment, not a list.Bug 2: bare identifiers are not auto-prefixed with
USGS-Doc states:
Verified against the live API:
Bare identifiers return HTTP 200 with zero rows and a different response schema. No client- or server-side prefixing occurs.
Likely origin
Both statements appear to have been carried over from
construct_waterdata_sample_request, whose multi-site/results/<profile>endpoint accepts list-valued query parameters. They do not apply to the single-site/summary/{id}endpoint wrapped by this function.Change
Replace the two statements with single-site guidance and an explicit note that the agency prefix is required.
Test plan
devtools::document()to refresh the.Rdfile from this roxygen change.Cross-reference
Identified during equivalent Python work in DOI-USGS/dataretrieval-python#262.