MCPcopy Create free account
hub / github.com/dask/dask / test_tokenize_without_pyarrow

Function test_tokenize_without_pyarrow

dask/array/tests/test_xarray.py:180–203  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

178
179@pytest.mark.filterwarnings("ignore:Passing an object to dask.array")
180def test_tokenize_without_pyarrow() -> None:
181 # https://github.com/dask/dask/issues/12072
182 import subprocess
183 import textwrap
184
185 code = textwrap.dedent("""\
186 import sys
187 sys.modules["pyarrow"] = None
188 import xarray as xr
189 import dask.array as da
190 import numpy as np
191 import dask
192
193 y = xr.DataArray(
194 data=da.zeros((1)),
195 dims=('y',),
196 coords={'y': np.arange(1)},
197 name='foo'
198 ).to_dataset()
199 y['foo'] = y.foo.dims, y.foo.data + 1
200 dask.optimize(y)
201 """)
202 out = subprocess.run([sys.executable, "-c", code], capture_output=True)
203 assert out.stderr == b""

Callers

nothing calls this directly

Calls 1

runMethod · 0.80

Tested by

no test coverage detected