xarray icon indicating copy to clipboard operation
xarray copied to clipboard

⚠️ Nightly upstream-dev CI failed ⚠️

Open github-actions[bot] opened this issue 3 years ago • 3 comments

Workflow Run URL

Python 3.10 Test Summary
xarray/tests/test_formatting.py::test__mapping_repr_recursive: ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.

github-actions[bot] avatar Oct 13 '22 00:10 github-actions[bot]

Is that a valid syntax: xr.Dataset({"a": [["x"], [1, 2, 3]]}), or does one need to use a tuple? It seems to use the full list as data and then fails because it is inhomogeneous.

Why does this only fail in upstream?

headtr1ck avatar Oct 13 '22 07:10 headtr1ck

It warns on the release version:

/Users/dcherian/mambaforge/envs/flox-tests/lib/python3.10/site-packages/xarray/core/variable.py:243: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
  data = np.asarray(data)

dcherian avatar Oct 14 '22 02:10 dcherian

Ok, then I think using a list to create a DataArray is not supported by xarray. I never noticed before, haha!

headtr1ck avatar Oct 14 '22 06:10 headtr1ck