Skip to content

Commit e87097f

Browse files
committed
Update test_pandas.py
1 parent abc2418 commit e87097f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pandas/tests/io/json/test_pandas.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import datetime
22
from datetime import timedelta
3-
from io import StringIO
3+
from io import StringIO, BytesIO
44
import json
55
import os
66
import sys
@@ -2186,10 +2186,10 @@ def test_read_json_dtype_backend(
21862186
@td.skip_if_no("pyarrow")
21872187
def test_read_json_pyarrow_with_dtype(self):
21882188
dtype = {"a": "int32[pyarrow]", "b": "int64[pyarrow]"}
2189-
json = '{"a": 1, "b": 2}'
2189+
json = b'{"a": 1, "b": 2}\n'
21902190

21912191
df = read_json(
2192-
StringIO(json),
2192+
BytesIO(json),
21932193
dtype=dtype,
21942194
lines=True,
21952195
engine="pyarrow",
@@ -2199,8 +2199,7 @@ def test_read_json_pyarrow_with_dtype(self):
21992199
result = df.dtypes
22002200
pa = pytest.importorskip("pyarrow")
22012201
expected = Series(
2202-
[pd.ArrowDtype(pa.int32()), pd.ArrowDtype(pa.int64())],
2203-
[
2202+
data=[
22042203
pd.ArrowDtype.construct_from_string("int32[pyarrow]"),
22052204
pd.ArrowDtype.construct_from_string("int64[pyarrow]"),
22062205
],

0 commit comments

Comments
 (0)