Skip to content

Commit 7ec38ae

Browse files
authored
Fix grouping by dask array (#322)
1 parent 676c0f0 commit 7ec38ae

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

flox/core.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,9 +1378,7 @@ def _extract_unknown_groups(reduced, dtype) -> tuple[DaskArray]:
13781378

13791379
groups_token = f"group-{reduced.name}"
13801380
first_block = reduced.ndim * (0,)
1381-
layer: Graph = {
1382-
(groups_token, *first_block): (operator.getitem, (reduced.name, *first_block), "groups")
1383-
}
1381+
layer: Graph = {(groups_token, 0): (operator.getitem, (reduced.name, *first_block), "groups")}
13841382
groups: tuple[DaskArray] = (
13851383
dask.array.Array(
13861384
HighLevelGraph.from_collections(groups_token, layer, dependencies=[reduced]),

tests/test_core.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,6 @@ def test_groupby_reduce(
169169
) -> None:
170170
array = array.astype(dtype)
171171
if chunk:
172-
if expected_groups is None:
173-
pytest.skip()
174172
array = da.from_array(array, chunks=(3,) if array.ndim == 1 else (1, 3))
175173
by = da.from_array(by, chunks=(3,) if by.ndim == 1 else (1, 3))
176174

0 commit comments

Comments
 (0)