Skip to content

TST: Add test for numpy.maximum with Timestamp and Series of datetime64 #59338

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

Merged
merged 1 commit into from
Jul 29, 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
16 changes: 16 additions & 0 deletions pandas/tests/arithmetic/test_datetime64.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,22 @@ def test_dt64_compare_datetime_scalar(self, datetimelike, op, expected):
expected = Series(expected, name="A")
tm.assert_series_equal(result, expected)

def test_ts_series_numpy_maximum(self):
# GH#50864, test numpy.maximum does not fail
# given a TimeStamp and Series(with dtype datetime64) comparison
ts = Timestamp("2024-07-01")
ts_series = Series(
["2024-06-01", "2024-07-01", "2024-08-01"],
dtype="datetime64[us]",
)

expected = Series(
["2024-07-01", "2024-07-01", "2024-08-01"],
dtype="datetime64[us]",
)

tm.assert_series_equal(expected, np.maximum(ts, ts_series))


class TestDatetimeIndexComparisons:
# TODO: moved from tests.indexes.test_base; parametrize and de-duplicate
Expand Down
Loading