We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6fb807d commit 1468aebCopy full SHA for 1468aeb
flox/xarray.py
@@ -62,7 +62,7 @@ def xarray_reduce(
62
fill_value=None,
63
method: str = "map-reduce",
64
engine: str = "flox",
65
- keep_attrs: bool = True,
+ keep_attrs: bool | None = True,
66
skipna: bool | None = None,
67
min_count: int | None = None,
68
reindex: bool | None = None,
@@ -181,6 +181,10 @@ def xarray_reduce(
181
if isinstance(b, xr.DataArray) and b.name is None:
182
raise ValueError("Cannot group by unnamed DataArrays.")
183
184
+ # TODO: move to GroupBy._flox_reduce
185
+ if keep_attrs is None:
186
+ keep_attrs = True
187
+
188
if isinstance(isbin, bool):
189
isbin = (isbin,) * len(by)
190
if expected_groups is None:
0 commit comments