home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 1280729879

This data as json

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/6803#issuecomment-1280729879 https://api.github.com/repos/pydata/xarray/issues/6803 1280729879 IC_kwDOAMm_X85MVmMX 6213168 2022-10-17T11:45:31Z 2022-10-17T11:45:31Z MEMBER

This is still an issue. I noticed that the documentation of map_blocks states: kwargs (mapping) – Passed verbatim to func after unpacking. xarray objects, if any, will not be subset to blocks. Passing dask collections in kwargs is not allowed.

Is this the case for apply_ufunc as well?

test_future is not a dask collection. It's a distributed.Future, which points to an arbitrary, opaque data blob that xarray has no means to know about.

FWIW, I could reproduce the issue, where the future in the kwargs is not resolved to the data it points to as one would expect. Minimal reproducer:

```python import distributed import xarray

client = distributed.Client(processes=False) x = xarray.DataArray([1, 2]).chunk() test_future = client.scatter("Hello World")

def f(d, test): print(test) return d

y = xarray.apply_ufunc( f, x, dask='parallelized', output_dtypes="float64", kwargs={'test':test_future}, ) y.compute() `` Expected print output:Hello WorldActual print output: <Future: finished, type: str, key: str-b012273bcde56eadf364cd3ce9b4ca26>`

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  1307523148
Powered by Datasette · Queries took 241.511ms · About: xarray-datasette