11import pytest
22
3- import pandas .util ._test_decorators as td
4-
53from pandas .core .dtypes .dtypes import PeriodDtype
64
75import pandas as pd
119 period_array ,
1210)
1311
14- pyarrow_skip = td . skip_if_no ("pyarrow" , min_version = "0.17.0 " )
12+ pa = pytest . importorskip ("pyarrow" , minversion = "1.0.1 " )
1513
1614
17- @pyarrow_skip
1815def test_arrow_extension_type ():
1916 from pandas .core .arrays ._arrow_utils import ArrowPeriodType
2017
@@ -29,7 +26,6 @@ def test_arrow_extension_type():
2926 assert not hash (p1 ) == hash (p3 )
3027
3128
32- @pyarrow_skip
3329@pytest .mark .parametrize (
3430 "data, freq" ,
3531 [
@@ -38,8 +34,6 @@ def test_arrow_extension_type():
3834 ],
3935)
4036def test_arrow_array (data , freq ):
41- import pyarrow as pa
42-
4337 from pandas .core .arrays ._arrow_utils import ArrowPeriodType
4438
4539 periods = period_array (data , freq = freq )
@@ -62,10 +56,7 @@ def test_arrow_array(data, freq):
6256 pa .array (periods , type = ArrowPeriodType ("T" ))
6357
6458
65- @pyarrow_skip
6659def test_arrow_array_missing ():
67- import pyarrow as pa
68-
6960 from pandas .core .arrays ._arrow_utils import ArrowPeriodType
7061
7162 arr = PeriodArray ([1 , 2 , 3 ], freq = "D" )
@@ -78,10 +69,7 @@ def test_arrow_array_missing():
7869 assert result .storage .equals (expected )
7970
8071
81- @pyarrow_skip
8272def test_arrow_table_roundtrip ():
83- import pyarrow as pa
84-
8573 from pandas .core .arrays ._arrow_utils import ArrowPeriodType
8674
8775 arr = PeriodArray ([1 , 2 , 3 ], freq = "D" )
@@ -100,10 +88,8 @@ def test_arrow_table_roundtrip():
10088 tm .assert_frame_equal (result , expected )
10189
10290
103- @pyarrow_skip
10491def test_arrow_load_from_zero_chunks ():
10592 # GH-41040
106- import pyarrow as pa
10793
10894 from pandas .core .arrays ._arrow_utils import ArrowPeriodType
10995
@@ -120,10 +106,7 @@ def test_arrow_load_from_zero_chunks():
120106 tm .assert_frame_equal (result , df )
121107
122108
123- @pyarrow_skip
124109def test_arrow_table_roundtrip_without_metadata ():
125- import pyarrow as pa
126-
127110 arr = PeriodArray ([1 , 2 , 3 ], freq = "H" )
128111 arr [1 ] = pd .NaT
129112 df = pd .DataFrame ({"a" : arr })
0 commit comments