From 925fef57439bfc6d72e63460224590f3d9bead88 Mon Sep 17 00:00:00 2001 From: zerj9 <96551236+zerj9@users.noreply.github.com> Date: Wed, 26 Jun 2024 11:25:38 +0100 Subject: [PATCH] literal strings to read_json being deprecated. use stringio. --- sdk/rapid/rapid.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/rapid/rapid.py b/sdk/rapid/rapid.py index b58223f..5ec9c77 100644 --- a/sdk/rapid/rapid.py +++ b/sdk/rapid/rapid.py @@ -4,6 +4,7 @@ from datetime import datetime from typing import Dict, Optional +from io import StringIO import pandas as pd @@ -139,12 +140,11 @@ def download_dataframe( data=json.dumps(query.dict(exclude_none=True)), timeout=TIMEOUT_PERIOD, ) - data = json.loads(response.content.decode("utf-8")) if response.status_code == 200: - return pd.read_json(json.dumps(data), orient="index") + return pd.read_json(StringIO(response.content.decode("utf-8")), orient="index") raise DatasetNotFoundException( - f"Could not find dataset, {layer}/{domain}/{dataset} to download", data + f"Could not find dataset, {layer}/{domain}/{dataset} to download", response.json() ) def upload_dataframe(