html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue
https://github.com/pydata/xarray/issues/5342#issuecomment-873660034,https://api.github.com/repos/pydata/xarray/issues/5342,873660034,MDEyOklzc3VlQ29tbWVudDg3MzY2MDAzNA==,302469,2021-07-04T20:50:24Z,2021-07-04T20:50:24Z,CONTRIBUTOR,"> What version of bottleneck are you testing it with? We require `bottleneck >=1.3` (https://github.com/pydata/xarray/blob/master/ci/requirements/py37-min-all-deps.yml)
This should go in `setup.cfg`, then? I'm not using conda.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,895202415
https://github.com/pydata/xarray/issues/5342#issuecomment-848943156,https://api.github.com/repos/pydata/xarray/issues/5342,848943156,MDEyOklzc3VlQ29tbWVudDg0ODk0MzE1Ng==,2448579,2021-05-26T16:52:50Z,2021-05-26T16:52:50Z,MEMBER,We should still make the changes proposed in https://github.com/pydata/xarray/issues/5342#issuecomment-844104261,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,895202415
https://github.com/pydata/xarray/issues/5342#issuecomment-845413014,https://api.github.com/repos/pydata/xarray/issues/5342,845413014,MDEyOklzc3VlQ29tbWVudDg0NTQxMzAxNA==,302469,2021-05-20T19:24:36Z,2021-05-20T19:24:36Z,CONTRIBUTOR,"Ah, you're right, it's still 1.2.1, I'll fix that.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,895202415
https://github.com/pydata/xarray/issues/5342#issuecomment-845280227,https://api.github.com/repos/pydata/xarray/issues/5342,845280227,MDEyOklzc3VlQ29tbWVudDg0NTI4MDIyNw==,14808389,2021-05-20T16:43:56Z,2021-05-20T16:44:28Z,MEMBER,"for reference, the failing call is:
```python
In [2]: bn.push(np.array([np.nan, 1.]), axis=0, n=None)
Out[2]: array([nan, 1.])
```
which should work with `bottleneck>=1.3` (I can reproduce the failure with `bottleneck=1.2.1`, which is the one you have in your environment).","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,895202415
https://github.com/pydata/xarray/issues/5342#issuecomment-845247492,https://api.github.com/repos/pydata/xarray/issues/5342,845247492,MDEyOklzc3VlQ29tbWVudDg0NTI0NzQ5Mg==,2448579,2021-05-20T16:01:50Z,2021-05-20T16:01:50Z,MEMBER,What version of bottleneck are you testing it with? We require `bottleneck >=1.3` (https://github.com/pydata/xarray/blob/master/ci/requirements/py37-min-all-deps.yml),"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,895202415
https://github.com/pydata/xarray/issues/5342#issuecomment-844764616,https://api.github.com/repos/pydata/xarray/issues/5342,844764616,MDEyOklzc3VlQ29tbWVudDg0NDc2NDYxNg==,302469,2021-05-20T06:54:15Z,2021-05-20T06:54:15Z,CONTRIBUTOR,"That seems insufficient:
```pytb
________________________________ test_push_dask ________________________________
[gw3] 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)
> np.testing.assert_equal(actual, expected)
/builddir/build/BUILDROOT/python-xarray-0.18.2-1.fc35.x86_64/usr/lib/python3.9/site-packages/xarray/tests/test_duck_array_ops.py:887:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.9/site-packages/dask/array/core.py:1476: in __array__
x = self.compute()
/usr/lib/python3.9/site-packages/dask/base.py:285: in compute
(result,) = compute(self, traverse=False, **kwargs)
/usr/lib/python3.9/site-packages/dask/base.py:567: in compute
results = schedule(dsk, keys, **kwargs)
/usr/lib/python3.9/site-packages/dask/local.py:560: in get_sync
return get_async(
/usr/lib/python3.9/site-packages/dask/local.py:503: in get_async
for key, res_info, failed in queue_get(queue).result():
/usr/lib64/python3.9/concurrent/futures/_base.py:438: in result
return self.__get_result()
/usr/lib64/python3.9/concurrent/futures/_base.py:390: in __get_result
raise self._exception
/usr/lib/python3.9/site-packages/dask/local.py:545: in submit
fut.set_result(fn(*args, **kwargs))
/usr/lib/python3.9/site-packages/dask/local.py:237: in batch_execute_tasks
return [execute_task(*a) for a in it]
/usr/lib/python3.9/site-packages/dask/local.py:237: in
return [execute_task(*a) for a in it]
/usr/lib/python3.9/site-packages/dask/local.py:228: in execute_task
result = pack_exception(e, dumps)
/usr/lib/python3.9/site-packages/dask/local.py:223: in execute_task
result = _execute_task(task, data)
/usr/lib/python3.9/site-packages/dask/core.py:121: in _execute_task
return func(*(_execute_task(a, cache) for a in args))
/usr/lib/python3.9/site-packages/dask/optimization.py:963: in __call__
return core.get(self.dsk, self.outkey, dict(zip(self.inkeys, args)))
/usr/lib/python3.9/site-packages/dask/core.py:151: in get
result = _execute_task(task, cache)
/usr/lib/python3.9/site-packages/dask/core.py:121: in _execute_task
return func(*(_execute_task(a, cache) for a in args))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
func = , args = [array([nan, 1.])]
kwargs = {'axis': 0, 'n': None}
def apply(func, args, kwargs=None):
if kwargs:
> return func(*args, **kwargs)
E TypeError: `n` must be an integer
/usr/lib/python3.9/site-packages/dask/utils.py:34: TypeError
```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,895202415
https://github.com/pydata/xarray/issues/5342#issuecomment-844104261,https://api.github.com/repos/pydata/xarray/issues/5342,844104261,MDEyOklzc3VlQ29tbWVudDg0NDEwNDI2MQ==,2448579,2021-05-19T13:25:25Z,2021-05-19T13:25:25Z,MEMBER,"Thanks. This is a new test.
Here's where the error is triggered:
https://github.com/pydata/xarray/blob/f3794ab1a75560f797b824c8c2d434aa65e7dd7d/xarray/core/dask_array_ops.py#L69-L73
We should specify both `dtype` and `meta` in the `map_*` calls like this:
``` python
pushed = array.map_blocks(push, axis=axis, n=n, dtype=array.dtype, meta=array._meta)
if len(array.chunks[axis]) > 1:
pushed = pushed.map_overlap(
push, axis=axis, n=n, depth={axis: (1, 0)}, boundary=""none"",
dtype=array.dtype, meta=array._meta
)
```
Can you send in a PR please?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,895202415