Skip to content

Commit 1468aeb

Browse files
committed
keep_attrs is True by default
1 parent 6fb807d commit 1468aeb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

flox/xarray.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def xarray_reduce(
6262
fill_value=None,
6363
method: str = "map-reduce",
6464
engine: str = "flox",
65-
keep_attrs: bool = True,
65+
keep_attrs: bool | None = True,
6666
skipna: bool | None = None,
6767
min_count: int | None = None,
6868
reindex: bool | None = None,
@@ -181,6 +181,10 @@ def xarray_reduce(
181181
if isinstance(b, xr.DataArray) and b.name is None:
182182
raise ValueError("Cannot group by unnamed DataArrays.")
183183

184+
# TODO: move to GroupBy._flox_reduce
185+
if keep_attrs is None:
186+
keep_attrs = True
187+
184188
if isinstance(isbin, bool):
185189
isbin = (isbin,) * len(by)
186190
if expected_groups is None:

0 commit comments

Comments
 (0)