[Git][debian-gis-team/flox][upstream] New upstream version 0.10.6
Antonio Valentino (@antonio.valentino)
gitlab at salsa.debian.org
Fri Aug 22 06:48:06 BST 2025
Antonio Valentino pushed to branch upstream at Debian GIS Project / flox
Commits:
3ec65bbd by Antonio Valentino at 2025-08-22T05:39:22+00:00
New upstream version 0.10.6
- - - - -
2 changed files:
- flox/core.py
- tests/test_xarray.py
Changes:
=====================================
flox/core.py
=====================================
@@ -892,7 +892,8 @@ def reindex_(
"Currently does not support reindexing with object arrays of tuples. "
"These occur when grouping by multi-indexed variables in xarray."
)
- if fill_value is xrdtypes.NA or isnull(fill_value):
+ # Use '==' instead of 'is', as Dask serialization can break identity checks.
+ if fill_value == xrdtypes.NA or isnull(fill_value):
new_dtype, fill_value = xrdtypes.maybe_promote(array.dtype)
else:
new_dtype = array.dtype
@@ -1380,7 +1381,8 @@ def _finalize_results(
if fill_value is None:
raise ValueError("Filling is required but fill_value is None.")
# This allows us to match xarray's type promotion rules
- if fill_value is xrdtypes.NA:
+ # Use '==' instead of 'is', as Dask serialization can break identity checks.
+ if fill_value == xrdtypes.NA:
new_dtype, fill_value = xrdtypes.maybe_promote(finalized[agg.name].dtype)
finalized[agg.name] = finalized[agg.name].astype(new_dtype)
=====================================
tests/test_xarray.py
=====================================
@@ -798,3 +798,16 @@ def test_groupby_preserve_dtype(reduction):
expected = getattr(np, reduction)(ds.test.data, axis=0).dtype
assert actual == expected
+
+
+ at requires_dask
+def test_resample_first_last_empty():
+ with xr.set_options(use_flox=True), dask.config.set(scheduler="processes"):
+ arr = xr.DataArray(
+ np.nan,
+ coords={
+ "date": pd.to_datetime(["2025-03-24", "2025-06-23"]),
+ },
+ dims=["date"],
+ ).chunk(date=(1, 1))
+ arr.resample(date="QE").last().compute()
View it on GitLab: https://salsa.debian.org/debian-gis-team/flox/-/commit/3ec65bbd1426863cbd33d0930d9b3640dce3fc4e
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/flox/-/commit/3ec65bbd1426863cbd33d0930d9b3640dce3fc4e
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20250822/4610373e/attachment-0001.htm>
More information about the Pkg-grass-devel
mailing list