Add pandas 3x, legacy xfails, and samples API key#221
Merged
thodson-usgs merged 4 commits intoDOI-USGS:mainfrom Mar 19, 2026
Merged
Add pandas 3x, legacy xfails, and samples API key#221thodson-usgs merged 4 commits intoDOI-USGS:mainfrom
thodson-usgs merged 4 commits intoDOI-USGS:mainfrom
Conversation
| """ | ||
| if "<html>" in rdb.lower() or "<!doctype html>" in rdb.lower(): | ||
| raise ValueError( | ||
| "Received HTML response instead of RDB. This often indicates " |
Collaborator
There was a problem hiding this comment.
I like this and plan to steal it in R!
ldecicco-USGS
approved these changes
Mar 19, 2026
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.
PR: Support for Pandas 3.0 and NWIS Service Migrations
Summary
This PR adds support for Pandas 3.0, handles the recent retirement of legacy NWIS RDB services (redirecting to HTML), and fixes a critical bug in API Key (PAT) header implementation.
Key Changes
1. Dependencies and Core Logic
pandasconstraint topandas>=2.0.0,<4.0.0.pd.to_datetimeto useformat="mixed". This ensures compatibility with Pandas 3.0's strict ISO8601 validation while handling datasets with mixed date/time formats.2. NWIS Module Enhancements
waterservices.usgs.govRDB endpoint.parameter_cdcolumn and other schema differences to ensure existing user code remains functional even as backend services evolve.3. API Key (PAT) Fix
X-Api-Keyheader whenAPI_USGS_PATis provided, resolving persistent 429 Rate Limit errors.4. Test Suite Maintenance
XFAIL.Verification Results
Verified with both Pandas 3.0.1 and Pandas 2.3.3: