Skip to content

test_dask_da_groupby_quantile not passing #9860

Closed
@QuLogic

Description

@QuLogic

What happened?

The test fails because the expected ValueError is not raised:

________________________ test_dask_da_groupby_quantile _________________________
[gw2] linux -- Python 3.13.0 /usr/bin/python3

    @requires_dask
    def test_dask_da_groupby_quantile() -> None:
        # Only works when the grouped reduction can run blockwise
        # Scalar quantile
        expected = xr.DataArray(
            data=[2, 5], coords={"x": [1, 2], "quantile": 0.5}, dims="x"
        )
        array = xr.DataArray(
            data=[1, 2, 3, 4, 5, 6], coords={"x": [1, 1, 1, 2, 2, 2]}, dims="x"
        )
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE <class 'ValueError'>

/builddir/build/BUILD/python-xarray-2024.11.0-build/BUILDROOT/usr/lib/python3.13/site-packages/xarray/tests/test_groupby.py:295: Failed

What did you expect to happen?

Test pass.

Minimal Complete Verifiable Example

pytest 'tests/test_groupby.py::test_dask_da_groupby_quantile'

MVCE confirmation

  • Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
  • Complete example — the example is self-contained, including all data and the text of any traceback.
  • Verifiable example — the example copy & pastes into an IPython prompt or Binder notebook, returning the result.
  • New issue — a search of GitHub Issues suggests this is not a duplicate.
  • Recent environment — the issue occurs with the latest version of xarray and its dependencies.

Relevant log output

No response

Anything else we need to know?

No response

Environment

INSTALLED VERSIONS ------------------ commit: None python: 3.13.0 (main, Oct 8 2024, 00:00:00) [GCC 14.2.1 20240912 (Red Hat 14.2.1-4)] python-bits: 64 OS: Linux OS-release: 6.11.5-200.fc40.x86_64 machine: x86_64 processor: byteorder: little LC_ALL: None LANG: C.UTF-8 LOCALE: ('C', 'UTF-8') libhdf5: 1.14.5 libnetcdf: 4.9.2

xarray: 2024.11.0
pandas: 2.2.1
numpy: 1.26.4
scipy: 1.14.1
netCDF4: 1.7.2
pydap: None
h5netcdf: None
h5py: None
zarr: 2.18.3
cftime: 1.6.4
nc_time_axis: None
iris: None
bottleneck: 1.3.7
dask: 2024.11.2
distributed: None
matplotlib: 3.9.1
cartopy: None
seaborn: 0.13.2
numbagg: None
fsspec: 2024.10.0
cupy: None
pint: 0.24.4
sparse: None
flox: None
numpy_groupies: None
setuptools: 74.1.3
pip: 24.3.1
conda: None
pytest: 8.3.3
mypy: None
IPython: None
sphinx: 7.3.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions