Skip to content

Commit

Permalink
literal strings to read_json being deprecated. use stringio.
Browse files Browse the repository at this point in the history
  • Loading branch information
zerj9 committed Jun 26, 2024
1 parent c01f5a9 commit 925fef5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sdk/rapid/rapid.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from datetime import datetime
from typing import Dict, Optional
from io import StringIO

import pandas as pd

Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 925fef5

Please sign in to comment.