Skip to content

Commit

Permalink
Comparison of Timestamp with datetime.date is deprecated
Browse files Browse the repository at this point in the history
Comparison of Timestamp with datetime.date is deprecated in order to match the standard library behavior.
  • Loading branch information
wilsonfreitas committed Jan 25, 2024
1 parent 287fc72 commit 82350b1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test_bizdays_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ def test_bizdays_with_timestamp():
def test_adjust_with_timestamp():
dt = pd.to_datetime("2021-12-30")
assert isinstance(actual.following(dt), pd.Timestamp)
assert actual.following(dt) == dt.date()
assert actual.preceding(dt) == dt.date()
assert actual.modified_following(dt) == dt.date()
assert actual.modified_preceding(dt) == dt.date()
assert actual.following(dt) == pd.Timestamp(dt.date())
assert actual.preceding(dt) == pd.Timestamp(dt.date())
assert actual.modified_following(dt) == pd.Timestamp(dt.date())
assert actual.modified_preceding(dt) == pd.Timestamp(dt.date())


def test_offset_with_timestamp():
dt = pd.to_datetime("2021-01-01")
assert isinstance(actual.offset(dt, 5), pd.Timestamp)
assert actual.offset(dt, 5) == pd.to_datetime("2021-01-06").date()
assert actual.offset(dt, 5) == pd.to_datetime("2021-01-06")


def test_isbizday_with_datetimeindex():
Expand Down

0 comments on commit 82350b1

Please sign in to comment.