Skip to content

Commit 16e727f

Browse files
committed
restructured test to avoid NameError: pa undefined
1 parent 29542b2 commit 16e727f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pandas/tests/copy_view/test_astype.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
Series,
1212
Timestamp,
1313
date_range,
14-
to_datetime,
1514
)
1615
import pandas._testing as tm
1716
from pandas.tests.copy_view.util import get_array
@@ -242,7 +241,13 @@ def test_convert_dtypes(using_infer_string):
242241
def test_convert_dtypes_pyarrow_timezone():
243242
# GH 60237
244243
expected = Series(
245-
to_datetime(range(5), utc=True, unit="h"),
244+
[
245+
"1970-01-01 00:00:00+00:00",
246+
"1970-01-01 01:00:00+00:00",
247+
"1970-01-01 02:00:00+00:00",
248+
"1970-01-01 03:00:00+00:00",
249+
"1970-01-01 04:00:00+00:00",
250+
],
246251
dtype="timestamp[ns, tz=UTC][pyarrow]",
247252
)
248253
result = expected.convert_dtypes(dtype_backend="pyarrow")

0 commit comments

Comments
 (0)