-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Description
Summary
dataretrieval.nwis.get_pmcodes() appears to return an HTML webpage response parsed into a one-column dataframe, rather than tabular parameter metadata.
Minimal reproducible example
from dataretrieval import nwis
df, meta = nwis.get_pmcodes(["00631"])
print("shape:", df.shape)
print("columns:", df.columns.tolist())
print("url:", getattr(meta, "url", None))
print("content-type:", getattr(meta, "header", {}).get("Content-Type"))
print(df.head(5).to_string(index=False))Actual output:
shape: (368, 1)
columns: ['<!DOCTYPE html>']
url: https://waterdata.usgs.gov/code-dictionary/
content-type: text/html; charset=utf-8
Expected behavior
nwis.get_pmcodes(["00631"]) should return a dataframe with parameter metadata fields (for example: parameter code, parameter name, units), not HTML content.
Environment
dataretrieval: 1.1.2
Python: 3.14.2
OS: macOS
Suspected cause
Upstream endpoint change/redirect/decommission.
Notes
Check how and whether this was addressed in DataRetrieval.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels