gerrymanoim / exchange_calendars

Calendars for various securities exchanges.
Apache License 2.0
425 stars 135 forks source link

FutureWarning: 'T' is deprecated and will be removed in a future version #357

Closed dmoklaf closed 8 months ago

dmoklaf commented 8 months ago

Got this in my log files while using the library:

/opt/homebrew/Caskroom/miniforge/base/envs/work/lib/python3.11/site-packages/exchange_calendars/exchange_calendar.py:2347: FutureWarning: 'T' is deprecated and will be removed in a future version. Please use 'min' instead of 'T'. align: pd.Timedelta | str = pd.Timedelta(1, "T")

Indeed comparing the pandas documentations between 1.x and 2.x versions and performing manual tests confirm that the warning is generated by this exact line, and that replacing "T" by "min" preserves the functionality across all pandas versions:

https://github.com/gerrymanoim/exchange_calendars/blob/9f0f500d7d448ce30db5e450255f5f9caec9ef16/exchange_calendars/exchange_calendar.py#L2347

Versions:

maread99 commented 8 months ago

Thanks @dmoklaf. All the pandas 2.2. deprecation warnings have been fixed in #358.