File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 1
1
import datetime
2
2
from datetime import timedelta
3
- from io import StringIO
3
+ from io import StringIO , BytesIO
4
4
import json
5
5
import os
6
6
import sys
@@ -2186,10 +2186,10 @@ def test_read_json_dtype_backend(
2186
2186
@td .skip_if_no ("pyarrow" )
2187
2187
def test_read_json_pyarrow_with_dtype (self ):
2188
2188
dtype = {"a" : "int32[pyarrow]" , "b" : "int64[pyarrow]" }
2189
- json = '{"a": 1, "b": 2}'
2189
+ json = b '{"a": 1, "b": 2}\n '
2190
2190
2191
2191
df = read_json (
2192
- StringIO (json ),
2192
+ BytesIO (json ),
2193
2193
dtype = dtype ,
2194
2194
lines = True ,
2195
2195
engine = "pyarrow" ,
@@ -2199,8 +2199,7 @@ def test_read_json_pyarrow_with_dtype(self):
2199
2199
result = df .dtypes
2200
2200
pa = pytest .importorskip ("pyarrow" )
2201
2201
expected = Series (
2202
- [pd .ArrowDtype (pa .int32 ()), pd .ArrowDtype (pa .int64 ())],
2203
- [
2202
+ data = [
2204
2203
pd .ArrowDtype .construct_from_string ("int32[pyarrow]" ),
2205
2204
pd .ArrowDtype .construct_from_string ("int64[pyarrow]" ),
2206
2205
],
You can’t perform that action at this time.
0 commit comments