From f6d18aa58102a97b8edab921716edcdfcea53ce5 Mon Sep 17 00:00:00 2001 From: mnfienen Date: Mon, 25 Sep 2023 14:39:58 -0500 Subject: [PATCH] (future warning fix): wrapping pd.read_json arg in StringIO to suppress pandas future warning about not passing a str (#112) --- dataretrieval/nwis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dataretrieval/nwis.py b/dataretrieval/nwis.py index acb1af6..a64a495 100644 --- a/dataretrieval/nwis.py +++ b/dataretrieval/nwis.py @@ -1171,7 +1171,7 @@ def _read_json(json): # read json, converting all values to float64 and all qualifiers # Lists can't be hashed, thus we cannot df.merge on a list column - record_df = pd.read_json(record_json, + record_df = pd.read_json(StringIO(record_json), orient='records', dtype={'value': 'float64', 'qualifiers': 'unicode'},