Skip to content

Commit 5da3722

Browse files
committed
Minor cleanup
1 parent 2a99eb0 commit 5da3722

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

dask_groupby/core.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -673,8 +673,7 @@ def _conc2(key1, key2=None, axis=None) -> np.ndarray:
673673
groups = _conc2("groups", axis=group_conc_axis)
674674

675675
if agg.reduction_type == "argreduce":
676-
677-
# If _count was added for masking later, we need to account for that
676+
# If "nanlen" was added for masking later, we need to account for that
678677
if agg.chunk[-1] == "nanlen":
679678
slicer = slice(None, -1)
680679
else:
@@ -875,7 +874,7 @@ def groupby_agg(
875874
concatenate=False,
876875
)
877876
output_chunks = reduced.chunks[: -(len(axis) + int(split_out > 1))] + (group_chunks,)
878-
else:
877+
elif method == "blockwise":
879878
# Blockwise apply the aggregation step so that one input chunk → one output chunk
880879
# TODO: We could combine this with the chunk reduction and do everything in one task.
881880
# This would also optimize the single block along reduced-axis case.
@@ -917,6 +916,8 @@ def groupby_agg(
917916
len(np.unique(by_maybe_numpy[i0:i1])) for i0, i1 in zip(bnds[:-1], bnds[1:])
918917
)
919918
output_chunks = reduced.chunks[: -(len(axis))] + (groups_per_chunk,)
919+
else:
920+
raise ValueError(f"Unknown method={method}.")
920921

921922
def _getitem(d, key1, key2):
922923
return d[key1][key2]

0 commit comments

Comments
 (0)