Skip to content

Commit 335fe18

Browse files
committed
Use pa_version_under19p0 in test_get_handle_pyarrow_compat
1 parent 4f0f95d commit 335fe18

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pandas/tests/io/test_common.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
WASM,
2424
is_platform_windows,
2525
)
26+
from pandas.compat.pyarrow import pa_version_under19p0
2627
import pandas.util._test_decorators as td
2728

2829
import pandas as pd
2930
import pandas._testing as tm
30-
from pandas.util.version import Version
3131

3232
import pandas.io.common as icom
3333

@@ -140,7 +140,6 @@ def test_bytesiowrapper_returns_correct_bytes(self):
140140

141141
# Test that pyarrow can handle a file opened with get_handle
142142
def test_get_handle_pyarrow_compat(self):
143-
pa = pytest.importorskip("pyarrow")
144143
pa_csv = pytest.importorskip("pyarrow.csv")
145144

146145
# Test latin1, ucs-2, and ucs-4 chars
@@ -154,7 +153,7 @@ def test_get_handle_pyarrow_compat(self):
154153
s = StringIO(data)
155154
with icom.get_handle(s, "rb", is_text=False) as handles:
156155
df = pa_csv.read_csv(handles.handle).to_pandas()
157-
if Version(pa.__version__) < Version("19.0"):
156+
if pa_version_under19p0:
158157
expected = expected.astype("object")
159158
tm.assert_frame_equal(df, expected)
160159
assert not s.closed

0 commit comments

Comments
 (0)