1
1
import numpy as np
2
2
import pytest
3
3
4
- import pandas .util ._test_decorators as td
5
-
6
4
import pandas as pd
7
5
from pandas import (
8
6
Index ,
@@ -249,12 +247,8 @@ def test_min_max(self, left_right_dtypes, index_or_series_or_array):
249
247
# Arrow interaction
250
248
251
249
252
- pyarrow_skip = td .skip_if_no ("pyarrow" )
253
-
254
-
255
- @pyarrow_skip
256
250
def test_arrow_extension_type ():
257
- import pyarrow as pa
251
+ pa = pytest . importorskip ( "pyarrow" )
258
252
259
253
from pandas .core .arrays .arrow .extension_types import ArrowIntervalType
260
254
@@ -269,9 +263,8 @@ def test_arrow_extension_type():
269
263
assert hash (p1 ) != hash (p3 )
270
264
271
265
272
- @pyarrow_skip
273
266
def test_arrow_array ():
274
- import pyarrow as pa
267
+ pa = pytest . importorskip ( "pyarrow" )
275
268
276
269
from pandas .core .arrays .arrow .extension_types import ArrowIntervalType
277
270
@@ -299,9 +292,8 @@ def test_arrow_array():
299
292
pa .array (intervals , type = ArrowIntervalType (pa .float64 (), "left" ))
300
293
301
294
302
- @pyarrow_skip
303
295
def test_arrow_array_missing ():
304
- import pyarrow as pa
296
+ pa = pytest . importorskip ( "pyarrow" )
305
297
306
298
from pandas .core .arrays .arrow .extension_types import ArrowIntervalType
307
299
@@ -329,14 +321,13 @@ def test_arrow_array_missing():
329
321
assert result .storage .equals (expected )
330
322
331
323
332
- @pyarrow_skip
333
324
@pytest .mark .parametrize (
334
325
"breaks" ,
335
326
[[0.0 , 1.0 , 2.0 , 3.0 ], date_range ("2017" , periods = 4 , freq = "D" )],
336
327
ids = ["float" , "datetime64[ns]" ],
337
328
)
338
329
def test_arrow_table_roundtrip (breaks ):
339
- import pyarrow as pa
330
+ pa = pytest . importorskip ( "pyarrow" )
340
331
341
332
from pandas .core .arrays .arrow .extension_types import ArrowIntervalType
342
333
@@ -363,14 +354,13 @@ def test_arrow_table_roundtrip(breaks):
363
354
tm .assert_frame_equal (result , expected [0 :0 ])
364
355
365
356
366
- @pyarrow_skip
367
357
@pytest .mark .parametrize (
368
358
"breaks" ,
369
359
[[0.0 , 1.0 , 2.0 , 3.0 ], date_range ("2017" , periods = 4 , freq = "D" )],
370
360
ids = ["float" , "datetime64[ns]" ],
371
361
)
372
362
def test_arrow_table_roundtrip_without_metadata (breaks ):
373
- import pyarrow as pa
363
+ pa = pytest . importorskip ( "pyarrow" )
374
364
375
365
arr = IntervalArray .from_breaks (breaks )
376
366
arr [1 ] = None
@@ -386,12 +376,11 @@ def test_arrow_table_roundtrip_without_metadata(breaks):
386
376
tm .assert_frame_equal (result , df )
387
377
388
378
389
- @pyarrow_skip
390
379
def test_from_arrow_from_raw_struct_array ():
391
380
# in case pyarrow lost the Interval extension type (eg on parquet roundtrip
392
381
# with datetime64[ns] subtype, see GH-45881), still allow conversion
393
382
# from arrow to IntervalArray
394
- import pyarrow as pa
383
+ pa = pytest . importorskip ( "pyarrow" )
395
384
396
385
arr = pa .array ([{"left" : 0 , "right" : 1 }, {"left" : 1 , "right" : 2 }])
397
386
dtype = pd .IntervalDtype (np .dtype ("int64" ), closed = "neither" )
0 commit comments