Skip to content

Commit 632f485

Browse files
committed
fix is_subperiod function after pandas has moved it to another module (pandas commit #17746)
1 parent b949e7d commit 632f485

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

timeboard/core.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
import re
1313
import six
1414

15+
try:
16+
_pandas_is_subperiod = pd.tseries.frequencies.is_subperiod
17+
except AttributeError:
18+
_pandas_is_subperiod = pandas._libs.tslibs.frequencies.is_subperiod
19+
1520
# # imports for timing the performance;
1621
# # there are also commented lines in the code referring to timeit or timers
1722
# import timeit
@@ -128,7 +133,7 @@ def _check_groupby_freq(base_unit_freq, group_by_freq):
128133
True if `group_by_freq` can be used for grouping, False otherwise.
129134
"""
130135
if bool(
131-
pd.tseries.frequencies.is_subperiod(base_unit_freq, group_by_freq)
136+
_pandas_is_subperiod(base_unit_freq, group_by_freq)
132137
# Some combinations of arguments result in is_subperiod function
133138
# returning nothing (NoneType)
134139
):

0 commit comments

Comments
 (0)