File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 25
25
26
26
import pyarrow as pa
27
27
import pyarrow .compute as pc
28
+ from pyarrow .vendored .version import Version
28
29
29
30
30
31
@pytest .mark .parametrize (['value' , 'ty' , 'klass' ], [
@@ -306,6 +307,11 @@ def test_timestamp():
306
307
dtype = 'datetime64[{}]' .format (unit )
307
308
arrow_arr = pa .Array .from_pandas (arr .astype (dtype ))
308
309
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" )
309
315
310
316
assert arrow_arr [0 ].as_py () == expected
311
317
assert arrow_arr [0 ].value * 1000 ** i == expected .value
@@ -318,6 +324,9 @@ def test_timestamp():
318
324
expected = (pd .Timestamp ('2000-01-01 12:34:56' )
319
325
.tz_localize ('utc' )
320
326
.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" )
321
330
322
331
assert arrow_arr [0 ].as_py () == expected
323
332
assert arrow_arr [0 ].value * 1000 ** i == expected .value
You can’t perform that action at this time.
0 commit comments