Skip to content

Commit

Permalink
Add warning message for qw data queries (#134)
Browse files Browse the repository at this point in the history
* add warning message for qw data queries

---------

Co-authored-by: Timothy Hodson <[email protected]>
  • Loading branch information
ehinman and thodson-usgs authored Mar 8, 2024
1 parent 4eba0a2 commit 593f420
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
18 changes: 16 additions & 2 deletions dataretrieval/nwis.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,14 @@ def get_qwdata(
.. warning::
WARNING: Beginning in February 2024 the NWIS qw data endpoint will not deliver new data or updates to existing data.
WARNING: Beginning in March 2024 the NWIS qw data endpoint will
not deliver new data or updates to existing data.
Eventually the endpoint will be retired. For updated information visit:
https://waterdata.usgs.gov.nwis/qwdata
For additional details, see the R package vignette:
https://doi-usgs.github.io/dataRetrieval/articles/Status.html
If you have additional questions about the qw data service, email [email protected].
If you have additional questions about the qw data service,
email [email protected].
Parameters
----------
Expand Down Expand Up @@ -175,6 +177,12 @@ def get_qwdata(
... )
"""
warnings.warn(('WARNING: Starting in March 2024, the NWIS qw data endpoint is '
'retiring and no longer receives updates. For more information, '
'refer to https://waterdata.usgs.gov.nwis/qwdata and '
'https://doi-usgs.github.io/dataRetrieval/articles/Status.html '
'or email [email protected].'))

_check_sites_value_types(sites)

kwargs['site_no'] = kwargs.pop('site_no', sites)
Expand Down Expand Up @@ -758,6 +766,12 @@ def get_info(ssl_check: bool = True, **kwargs) -> Tuple[pd.DataFrame, BaseMetada
"""
seriesCatalogOutput = kwargs.pop('seriesCatalogOutput', None)
if seriesCatalogOutput in ['True', 'TRUE', 'true', True]:

warnings.warn(('WARNING: Starting in March 2024, the NWIS qw data endpoint is '
'retiring and no longer receives updates. For more information, '
'refer to https://waterdata.usgs.gov.nwis/qwdata and '
'https://doi-usgs.github.io/dataRetrieval/articles/Status.html '
'or email [email protected].'))
# convert bool to string if necessary
kwargs['seriesCatalogOutput'] = 'True'
else:
Expand Down
4 changes: 2 additions & 2 deletions dataretrieval/wqp.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,8 @@ def _warn_v3_profiles_outage():
"""Private function for warning message about WQX 3.0 profiles
"""

warnings.warn(('NEWS: USGS discrete water quality data availability '
'and format are changing. Beginning in February 2024 '
warnings.warn(('USGS discrete water quality data availability '
'and format are changing. Beginning in March 2024 '
'the data obtained from legacy profiles will not '
'include new USGS data or recent updates to existing '
'data. To view the status of changes in data '
Expand Down

0 comments on commit 593f420

Please sign in to comment.