Skip to content

Commit

Permalink
add make_meta_dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
fjetter committed Jan 16, 2024
1 parent 56487cd commit e1b189d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dask_expr/_expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
safe_head,
total_mem_usage,
)
from dask.dataframe.dispatch import meta_nonempty
from dask.dataframe.dispatch import make_meta_dispatch, meta_nonempty
from dask.dataframe.rolling import CombinedOutput, _head_timedelta, overlap_chunk
from dask.dataframe.shuffle import drop_overlap, get_overlap
from dask.dataframe.utils import (
Expand Down Expand Up @@ -3086,3 +3086,10 @@ def __len__(self):

def __iter__(self):
return iter(self.operands)


@make_meta_dispatch.register(Expr)
def make_meta_expr(expr, index=None):
# make_meta only access the _meta attribute for collections but Expr is not
# a collection. Still, we're sometimes calling make_meta on Expr instances
return expr._meta

0 comments on commit e1b189d

Please sign in to comment.