From bcae0f19244b1354d0fe37a04be437a9d4e9577a Mon Sep 17 00:00:00 2001 From: Stefan Binder Date: Mon, 9 Oct 2023 20:51:11 +0200 Subject: [PATCH] Maint: Do not pass literal json to read_json in test (#3221) --- tests/utils/test_utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/utils/test_utils.py b/tests/utils/test_utils.py index 65e0ac0f3..c0334533a 100644 --- a/tests/utils/test_utils.py +++ b/tests/utils/test_utils.py @@ -1,9 +1,10 @@ -import pytest -import warnings +import io import json +import warnings import numpy as np import pandas as pd +import pytest from altair.utils import infer_vegalite_type, sanitize_dataframe @@ -68,7 +69,7 @@ def test_sanitize_dataframe(): print(s) # Re-construct pandas dataframe - df2 = pd.read_json(s) + df2 = pd.read_json(io.StringIO(s)) # Re-order the columns to match df df2 = df2[df.columns]