mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-01 03:40:51 +08:00
6a2ee7c417
The bug occurred because there is a special case in the initial window setup code for handling the case where only a length-1 history is used for a given frequency. Previously, the code was incorrectly calculating the period end using a hard-coded expression for the end of the day (the correct behavior for a length-1 '1d' history), and then using the frequency object to calculate the period start for the window. In the case of length 1 '1m' data, this resulted in an initial window whose start and end was the last minute of the day rather than the first minute of the day. For non-price fields, this error doesn't matter, because the window is only used for rolling digests (which doesn't happen when there's only a length-1 history), and for the forward-filling logic (which only happens on price fields). For a length-1 '1m' price, however, the incorrect window causes us to attempt to forward-fill an empty panel, resulting in an IndexError when we do an iloc[0] on a length-0 axis.