From 42c4dda2228a30db1211d800c2065c7d5f30d38c Mon Sep 17 00:00:00 2001 From: Charles Graham SWT Date: Wed, 26 Feb 2025 12:05:25 -0600 Subject: [PATCH 1/2] Ensure list is also allowed in json.dump conversion for patch and post --- cwms/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cwms/api.py b/cwms/api.py index 1dba6bee..17267ffb 100644 --- a/cwms/api.py +++ b/cwms/api.py @@ -309,7 +309,7 @@ def post( # post requires different headers than get for headers = {"accept": "*/*", "Content-Type": api_version_text(api_version)} - if isinstance(data, dict): + if isinstance(data, dict) or isinstance(data, list): data = json.dumps(data) response = SESSION.post(endpoint, params=params, headers=headers, data=data) @@ -349,7 +349,7 @@ def patch( if data is None: response = SESSION.patch(endpoint, params=params, headers=headers) else: - if isinstance(data, dict): + if isinstance(data, dict) or isinstance(data, list): data = json.dumps(data) response = SESSION.patch(endpoint, params=params, headers=headers, data=data) response.close() From 003ebe15845743fb5e12554682035bf19efb0ce5 Mon Sep 17 00:00:00 2001 From: Charles Graham SWT Date: Wed, 26 Feb 2025 12:07:28 -0600 Subject: [PATCH 2/2] Bump pypi version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6119bd69..3a05ca7a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "cwms-python" -version = "0.5.5" +version = "0.5.6" packages = [ { include = "cwms" },