CLN: CacheableOffset not Properly Used · Issue #4609 · pandas-dev/pandas (original) (raw)

I believe that many of the DateOffsets that extend CacheableOffset do so incorrectly.

Looking at pandas.tseries.offsets, there are some subclasses of DateOffset are declared as class Foo(DateOffset, CacheableOffset) and some as class Foo(CacheableOffset, DateOffset).

All that CacheableOffset does is to set the class field _cacheable = True. DateOffset sets _cacheable = False. Therefore, depending on the order of the parent classes, in some cases _cacheable will be False and some cases True