home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 895202415

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
895202415 MDU6SXNzdWU4OTUyMDI0MTU= 5342 test_push_dask fails type inference 302469 closed 0     7 2021-05-19T09:20:24Z 2021-07-05T17:24:27Z 2021-07-05T17:24:27Z CONTRIBUTOR      

What happened: When building the Fedora package of xarray 0.18.0/0.18.1, test_push_dask failed. This did not happen in previous versions (or the test did not exist then.)

Minimal Complete Verifiable Example:

```pytb _____ testpush_dask ______ [gw2] linux -- Python 3.9.5 /usr/bin/python3 @requires_dask @requires_bottleneck def test_push_dask(): import bottleneck import dask.array

    array = np.array([np.nan, np.nan, np.nan, 1, 2, 3, np.nan, np.nan, 4, 5, np.nan, 6])
    expected = bottleneck.push(array, axis=0)
    for c in range(1, 11):
        with raise_if_dask_computes():
          actual = push(dask.array.from_array(array, chunks=c), axis=0, n=None)

/builddir/build/BUILDROOT/python-xarray-0.18.1-1.fc35.x86_64/usr/lib/python3.9/site-packages/xarray/tests/test_duck_array_ops.py:886:


/builddir/build/BUILDROOT/python-xarray-0.18.1-1.fc35.x86_64/usr/lib/python3.9/site-packages/xarray/core/duck_array_ops.py:663: in push return dask_array_ops.push(array, n, axis) /builddir/build/BUILDROOT/python-xarray-0.18.1-1.fc35.x86_64/usr/lib/python3.9/site-packages/xarray/core/dask_array_ops.py:69: in push pushed = array.map_blocks(push, axis=axis, n=n) /usr/lib/python3.9/site-packages/dask/array/core.py:2333: in map_blocks return map_blocks(func, self, args, *kwargs) /usr/lib/python3.9/site-packages/dask/array/core.py:683: in map_blocks dtype = apply_infer_dtype(func, args, original_kwargs, "map_blocks")


func = <built-in function push>, args = [array([1.])] kwargs = {'axis': 0, 'n': None}, funcname = 'map_blocks' suggest_dtype = 'dtype', nout = None def apply_infer_dtype(func, args, kwargs, funcname, suggest_dtype="dtype", nout=None): """ Tries to infer output dtype of func for a small set of input arguments.

    Parameters
    ----------
    func: Callable
        Function for which output dtype is to be determined

    args: List of array like
        Arguments to the function, which would usually be used. Only attributes
        ``ndim`` and ``dtype`` are used.

    kwargs: dict
        Additional ``kwargs`` to the ``func``

    funcname: String
        Name of calling function to improve potential error messages

    suggest_dtype: None/False or String
        If not ``None`` adds suggestion to potential error message to specify a dtype
        via the specified kwarg. Defaults to ``'dtype'``.

    nout: None or Int
        ``None`` if function returns single output, integer if many.
        Deafults to ``None``.

    Returns
    -------
    : dtype or List of dtype
        One or many dtypes (depending on ``nout``)
    """
    args = [
        np.ones((1,) * x.ndim, dtype=x.dtype) if isinstance(x, Array) else x
        for x in args
    ]
    try:
        with np.errstate(all="ignore"):
            o = func(*args, **kwargs)
    except Exception as e:
        exc_type, exc_value, exc_traceback = sys.exc_info()
        tb = "".join(traceback.format_tb(exc_traceback))
        suggest = (
            (
                "Please specify the dtype explicitly using the "
                "`{dtype}` kwarg.\n\n".format(dtype=suggest_dtype)
            )
            if suggest_dtype
            else ""
        )
        msg = (
            "`dtype` inference failed in `{0}`.\n\n"
            "{1}"
            "Original error is below:\n"
            "------------------------\n"
            "{2}\n\n"
            "Traceback:\n"
            "---------\n"
            "{3}"
        ).format(funcname, suggest, repr(e), tb)
    else:
        msg = None
    if msg is not None:
      raise ValueError(msg)

E ValueError: dtype inference failed in map_blocks. E
E Please specify the dtype explicitly using the dtype kwarg. E
E Original error is below: E ------------------------ E TypeError('n must be an integer') E
E Traceback: E --------- E File "/usr/lib/python3.9/site-packages/dask/array/core.py", line 383, in apply_infer_dtype E o = func(args, *kwargs) /usr/lib/python3.9/site-packages/dask/array/core.py:408: ValueError ```

Anything else we need to know?:

Environment:

Output of <tt>xr.show_versions()</tt> ``` INSTALLED VERSIONS ------------------ commit: None python: 3.9.5 (default, May 4 2021, 00:00:00) [GCC 11.1.1 20210428 (Red Hat 11.1.1-1)] python-bits: 64 OS: Linux OS-release: 5.11.19-300.fc34.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: C LOCALE: ('en_US', 'UTF-8') libhdf5: 1.10.6 libnetcdf: 4.7.3 xarray: 0.18.1 pandas: 1.2.1 numpy: 1.20.1 scipy: 1.6.2 netCDF4: 1.5.6 pydap: None h5netcdf: None h5py: None Nio: None zarr: 2.8.1 cftime: 1.4.1 nc_time_axis: None PseudoNetCDF: None rasterio: 1.2.1 cfgrib: None iris: None bottleneck: 1.2.1 dask: 2021.04.1 distributed: None matplotlib: 3.4.2 cartopy: None seaborn: None numbagg: None pint: 0.16.1 setuptools: 56.1.0 pip: None conda: None pytest: 6.2.4 IPython: None sphinx: None ```
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5342/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 1 row from issues_id in issues_labels
  • 7 rows from issue in issue_comments
Powered by Datasette · Queries took 0.601ms · About: xarray-datasette