Skip to content

Commit d9bbfe7

Browse files
GH-33696: [CI][Python] Fix nightly CI for timestamp failure in pandas dev build
1 parent 7319250 commit d9bbfe7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

python/pyarrow/tests/test_scalars.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
import pyarrow as pa
2727
import pyarrow.compute as pc
28+
from pyarrow.vendored.version import Version
2829

2930

3031
@pytest.mark.parametrize(['value', 'ty', 'klass'], [
@@ -306,6 +307,11 @@ def test_timestamp():
306307
dtype = 'datetime64[{}]'.format(unit)
307308
arrow_arr = pa.Array.from_pandas(arr.astype(dtype))
308309
expected = pd.Timestamp('2000-01-01 12:34:56')
310+
if Version("2.0.0.dev0") <= Version(pd.__version__) < Version("2.0.0"):
311+
# TODO: regression in pandas, should be fixed before final 2.0.0
312+
# https://github.com/apache/arrow/issues/33696
313+
# https://github.com/pandas-dev/pandas/issues/49076
314+
expected = expected.as_unit("ns")
309315

310316
assert arrow_arr[0].as_py() == expected
311317
assert arrow_arr[0].value * 1000**i == expected.value
@@ -318,6 +324,9 @@ def test_timestamp():
318324
expected = (pd.Timestamp('2000-01-01 12:34:56')
319325
.tz_localize('utc')
320326
.tz_convert(tz))
327+
if Version("2.0.0.dev0") <= Version(pd.__version__) < Version("2.0.0"):
328+
# TODO: regression in pandas, should be fixed before final 2.0.0
329+
expected = expected.as_unit("ns")
321330

322331
assert arrow_arr[0].as_py() == expected
323332
assert arrow_arr[0].value * 1000**i == expected.value

0 commit comments

Comments
 (0)