Skip to content

Commit d3cb1a1

Browse files
committed
use partial for dak blockwise callables
1 parent 1651347 commit d3cb1a1

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/dask_histogram/core.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,15 +1027,8 @@ def _partitioned_histogram(
10271027
if len(data) == 1 and data_is_dak:
10281028
from dask_awkward.lib.core import partitionwise_layer as dak_pwl
10291029

1030-
x = data[0]
1031-
if weights is not None and sample is not None:
1032-
g = dak_pwl(_blocked_dak, name, x, weights, sample, histref=histref)
1033-
elif weights is not None and sample is None:
1034-
g = dak_pwl(_blocked_dak, name, x, weights, None, histref=histref)
1035-
elif weights is None and sample is not None:
1036-
g = dak_pwl(_blocked_dak, name, x, None, sample, histref=histref)
1037-
else:
1038-
g = dak_pwl(_blocked_dak, name, x, None, None, histref=histref)
1030+
f = partial(_blocked_dak, weights=weights, sample=sample, histref=histref)
1031+
g = dak_pwl(f, name, data[0])
10391032

10401033
# Single object, not a dataframe
10411034
elif len(data) == 1 and not data_is_df:

0 commit comments

Comments
 (0)