Skip to content

Fix missing comma in get_reference_table doctest example#275

Merged
thodson-usgs merged 1 commit into
DOI-USGS:mainfrom
thodson-usgs:fix-docstring-example-syntax
May 13, 2026
Merged

Fix missing comma in get_reference_table doctest example#275
thodson-usgs merged 1 commit into
DOI-USGS:mainfrom
thodson-usgs:fix-docstring-example-syntax

Conversation

@thodson-usgs
Copy link
Copy Markdown
Collaborator

@thodson-usgs thodson-usgs commented May 13, 2026

The second example block in get_reference_table's docstring is unrunnable — collection="parameter-codes" and query={...} are on separate lines with no comma between them, so the doctest text would not parse as a valid Python call.

Before (broken)

```python

ref, md = dataretrieval.waterdata.get_reference_table(
... collection="parameter-codes"
... query={'id': '00001,00002'}
... )
```

After

```python

ref, md = dataretrieval.waterdata.get_reference_table(
... collection="parameter-codes",
... query={"id": "00001,00002"},
... )
```

(Single quotes inside the dict are normalized to double quotes to match the rest of the file's style — drive-by, no functional change.)

Why

Surfaced while running each public-function docstring example against the live USGS OGC API as part of PR #229's verification pass.

🤖 Generated with Claude Code

The second example block in `get_reference_table`'s docstring was
unrunnable: `collection="parameter-codes"` and `query={...}` were on
separate lines with no comma between them, so the doctest text doesn't
parse as a valid call.

Surfaced from PR DOI-USGS#229's verification pass where I executed each public
function's docstring example against the live USGS OGC API.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@thodson-usgs thodson-usgs force-pushed the fix-docstring-example-syntax branch from 0bd1c3b to b98a27d Compare May 13, 2026 16:03
@thodson-usgs thodson-usgs changed the title Fix syntax errors in two waterdata doctest examples Fix missing comma in get_reference_table doctest example May 13, 2026
@thodson-usgs thodson-usgs requested a review from Copilot May 13, 2026 16:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a syntax error in the get_reference_table docstring example so the illustrated multi-line function call is valid Python, improving documentation reliability for the waterdata API.

Changes:

  • Add the missing comma between collection=... and query=... in the second example block.
  • Normalize the example dict quoting to double quotes for consistency within the docstring.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@thodson-usgs thodson-usgs merged commit da49749 into DOI-USGS:main May 13, 2026
12 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