Skip to content

Unstable dask causes unexpected compute results from xarray #7263

@djhoese

Description

@djhoese

What happened:

See pydata/xarray#4934 for details. Some change in dask master branch seems to be causing an internal xarray array wrapper to be returned instead of a numpy array.

What you expected to happen:
A numpy array to be returned by .compute().

Minimal Complete Verifiable Example:

from PIL import Image
import xarray as xr
import numpy as np

# create a test image
Image.fromarray(np.zeros((5, 5, 3), dtype=np.uint8)).save('test.png')
r = xr.open_rasterio('test.png', chunks='auto')
print(r.data.compute())
# ImplicitToExplicitIndexingAdapter(array=CopyOnWriteArray(array=LazilyOuterIndexedArray(array=<xarray.backends.rasterio_.RasterioArrayWrapper object at 0x7f25e72bcc10>, key=BasicIndexer((slice(0, 2, 1), slice(0, 100, 1), slice(0, 100, 1))))))

Anything else we need to know?:
This was originally discovered in a CI environment with unstable dependencies installed (ex. numpy, xarray, dask, and rasterio), but seems to be tied to dask. Reverting dask versions to latest release fixes it.

Environment:

  • Dask version: ad01acc
  • Python version:
  • Operating System:
  • Install method (conda, pip, source):

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