Skip to content

Commit c54ceec

Browse files
authored
TST: Add tests to ensure proper conversion of datetime64/timedelta64/timestamp/duration to and from pyarrow (#54356)
* add pyarrow conversion pytests * make test match GH issue and move test to proper location * fix naming of expected and result variables for assertion * optimize test * make test mirror GH #54191 * fix test logic
1 parent 79ce72b commit c54ceec

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/tests/frame/methods/test_convert_dtypes.py

+8
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,11 @@ def test_convert_dtypes_pyarrow_to_np_nullable(self):
167167
result = ser.convert_dtypes(dtype_backend="numpy_nullable")
168168
expected = pd.DataFrame(range(2), dtype="Int32")
169169
tm.assert_frame_equal(result, expected)
170+
171+
def test_convert_dtypes_pyarrow_timestamp(self):
172+
# GH 54191
173+
pytest.importorskip("pyarrow")
174+
ser = pd.Series(pd.date_range("2020-01-01", "2020-01-02", freq="1min"))
175+
expected = ser.astype("timestamp[ms][pyarrow]")
176+
result = expected.convert_dtypes(dtype_backend="pyarrow")
177+
tm.assert_series_equal(result, expected)

0 commit comments

Comments
 (0)