File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 27
27
28
28
import pandas as pd
29
29
import pandas ._testing as tm
30
+ from pandas .util .version import Version
30
31
31
32
import pandas .io .common as icom
32
33
@@ -139,6 +140,7 @@ def test_bytesiowrapper_returns_correct_bytes(self):
139
140
140
141
# Test that pyarrow can handle a file opened with get_handle
141
142
def test_get_handle_pyarrow_compat (self ):
143
+ pa = pytest .importorskip ("pyarrow" )
142
144
pa_csv = pytest .importorskip ("pyarrow.csv" )
143
145
144
146
# Test latin1, ucs-2, and ucs-4 chars
@@ -152,8 +154,8 @@ def test_get_handle_pyarrow_compat(self):
152
154
s = StringIO (data )
153
155
with icom .get_handle (s , "rb" , is_text = False ) as handles :
154
156
df = pa_csv .read_csv (handles .handle ).to_pandas ()
155
- # TODO will have to update this when pyarrow' to_pandas() is fixed
156
- expected = expected .astype ("object" )
157
+ if Version ( pa . __version__ ) < Version ( "19.0" ):
158
+ expected = expected .astype ("object" )
157
159
tm .assert_frame_equal (df , expected )
158
160
assert not s .closed
159
161
You can’t perform that action at this time.
0 commit comments