-
Notifications
You must be signed in to change notification settings - Fork 15
Closed
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
Pandas v2.0 changes the behaviour of equality comparisons of pandas.Timestamp and datetime.date objects to always compare as unequal (pandas-dev/pandas#36131). For example
import datetime, pandas
print(pandas.Timestamp(2010, 1, 1) == datetime.date(2010, 1, 1))outputs True in Pandas v1.2.2 and False in v2.0.0.
This causes the assert in tests/test_control_order_of_events.py::test_control_of_ordering_in_the_day
TLOmodel/tests/test_control_order_of_events.py
Lines 92 to 97 in 5655119
| events['date'] = pd.to_datetime(events['date']).dt.date | |
| order_on_day_one = tuple(events.loc[events['date'] == Date(2010, 1, 1), 'id']) | |
| assert order_on_day_one == ("EventForStartOfDay", | |
| "EventForMiddleOfDay", | |
| "EventForSecondToLastAtEndOfDay", | |
| "EventForEndOfDay") |
to fail when running with Pandas v2.0.0 as the earlier comparison with a Date object (corresponding to a pandas.Timestamp) no longer behaves as expected.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working