1
1
import pytest
2
2
3
- import pandas .util ._test_decorators as td
4
-
5
3
from pandas .core .dtypes .dtypes import PeriodDtype
6
4
7
5
import pandas as pd
11
9
period_array ,
12
10
)
13
11
14
- pyarrow_skip = td . skip_if_no ("pyarrow" , min_version = "0.17.0 " )
12
+ pa = pytest . importorskip ("pyarrow" , minversion = "1.0.1 " )
15
13
16
14
17
- @pyarrow_skip
18
15
def test_arrow_extension_type ():
19
16
from pandas .core .arrays ._arrow_utils import ArrowPeriodType
20
17
@@ -29,7 +26,6 @@ def test_arrow_extension_type():
29
26
assert not hash (p1 ) == hash (p3 )
30
27
31
28
32
- @pyarrow_skip
33
29
@pytest .mark .parametrize (
34
30
"data, freq" ,
35
31
[
@@ -38,8 +34,6 @@ def test_arrow_extension_type():
38
34
],
39
35
)
40
36
def test_arrow_array (data , freq ):
41
- import pyarrow as pa
42
-
43
37
from pandas .core .arrays ._arrow_utils import ArrowPeriodType
44
38
45
39
periods = period_array (data , freq = freq )
@@ -62,10 +56,7 @@ def test_arrow_array(data, freq):
62
56
pa .array (periods , type = ArrowPeriodType ("T" ))
63
57
64
58
65
- @pyarrow_skip
66
59
def test_arrow_array_missing ():
67
- import pyarrow as pa
68
-
69
60
from pandas .core .arrays ._arrow_utils import ArrowPeriodType
70
61
71
62
arr = PeriodArray ([1 , 2 , 3 ], freq = "D" )
@@ -78,10 +69,7 @@ def test_arrow_array_missing():
78
69
assert result .storage .equals (expected )
79
70
80
71
81
- @pyarrow_skip
82
72
def test_arrow_table_roundtrip ():
83
- import pyarrow as pa
84
-
85
73
from pandas .core .arrays ._arrow_utils import ArrowPeriodType
86
74
87
75
arr = PeriodArray ([1 , 2 , 3 ], freq = "D" )
@@ -100,10 +88,8 @@ def test_arrow_table_roundtrip():
100
88
tm .assert_frame_equal (result , expected )
101
89
102
90
103
- @pyarrow_skip
104
91
def test_arrow_load_from_zero_chunks ():
105
92
# GH-41040
106
- import pyarrow as pa
107
93
108
94
from pandas .core .arrays ._arrow_utils import ArrowPeriodType
109
95
@@ -120,10 +106,7 @@ def test_arrow_load_from_zero_chunks():
120
106
tm .assert_frame_equal (result , df )
121
107
122
108
123
- @pyarrow_skip
124
109
def test_arrow_table_roundtrip_without_metadata ():
125
- import pyarrow as pa
126
-
127
110
arr = PeriodArray ([1 , 2 , 3 ], freq = "H" )
128
111
arr [1 ] = pd .NaT
129
112
df = pd .DataFrame ({"a" : arr })
0 commit comments