Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix datetime binop pytest failures in pandas-2.2 #15090

Merged
merged 2 commits into from
Feb 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions python/cudf/cudf/tests/test_binops.py
Original file line number Diff line number Diff line change
Expand Up @@ -1796,7 +1796,13 @@ def test_datetime_dateoffset_binaryop(
"ignore:Discarding nonzero nanoseconds:UserWarning"
)
@pytest.mark.parametrize("op", [operator.add, operator.sub])
def test_datetime_dateoffset_binaryop_multiple(date_col, kwargs, op):
def test_datetime_dateoffset_binaryop_multiple(request, date_col, kwargs, op):
request.applymarker(
pytest.mark.xfail(
PANDAS_GE_220 and len(kwargs) == 1 and "milliseconds" in kwargs,
reason="https://github.com/pandas-dev/pandas/issues/57529",
)
)
gsr = cudf.Series(date_col, dtype="datetime64[ns]")
psr = gsr.to_pandas()

Expand Down Expand Up @@ -1864,7 +1870,9 @@ def test_datetime_dateoffset_binaryop_reflected(
expect = poffset + psr
got = goffset + gsr

utils.assert_eq(expect, got)
# TODO: Remove check_dtype once we get some clarity on:
# https://github.com/pandas-dev/pandas/issues/57448
utils.assert_eq(expect, got, check_dtype=not PANDAS_GE_220)

with pytest.raises(TypeError):
poffset - psr
Expand Down
Loading