From 7cf10f1adbcc327eafcc3a6d18f40b15ba8b3770 Mon Sep 17 00:00:00 2001 From: thodson-usgs Date: Sat, 30 May 2026 14:17:46 -0400 Subject: [PATCH] fix(nwis): stop emitting a DeprecationWarning at import time nwis.py warned at module top-level, and dataretrieval/__init__ star-imports nwis, so `import dataretrieval` emitted a DeprecationWarning for every consumer (including waterdata-only users) and failed to import entirely under `-W error::DeprecationWarning`, which is common in CI. Deprecation is already signaled where it matters: the @_deprecated decorator emits a per-function warning on every nwis call. Removed the redundant module-level warning; the per-function warnings are unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) --- dataretrieval/nwis.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/dataretrieval/nwis.py b/dataretrieval/nwis.py index 6a1ed472..4ca95433 100644 --- a/dataretrieval/nwis.py +++ b/dataretrieval/nwis.py @@ -24,14 +24,6 @@ except ImportError: gpd = None -# Issue deprecation warning upon import -warnings.warn( - "The 'nwis' services are deprecated and being decommissioned. " - "Please use the 'waterdata' module to access the new services.", - DeprecationWarning, - stacklevel=2, -) - WATERDATA_BASE_URL = "https://nwis.waterdata.usgs.gov/" WATERDATA_URL = WATERDATA_BASE_URL + "nwis/" WATERSERVICE_URL = "https://waterservices.usgs.gov/nwis/"