The object returned by group_by_dynamic has different methods in lazy vs eager mode.
Specifically, the method group_by_dynamic returns LazyGroupBy for a LazyFrame and DynamicGroupBy for a eager DataFrame. These two objects have slightly different APIs.
So, for example it possible to call .len() on the lazy version but not in the eager version. Here an example:
Description
The object returned by
group_by_dynamic
has different methods in lazy vs eager mode.Specifically, the method
group_by_dynamic
returnsLazyGroupBy
for aLazyFrame
andDynamicGroupBy
for a eagerDataFrame
. These two objects have slightly different APIs.So, for example it possible to call
.len()
on the lazy version but not in the eager version. Here an example:It appears to be a similar issue with the
.reasample()
method, as noted in the original report on SO: https://stackoverflow.com/questions/78714929/polars-group-by-dynamic-and-len-lazy-vs-eager?noredirect=1#comment138785003_78714929Shouldn't these two APIs we aligned? Or this difference is a design choice?