Describe the bug
Numpy 1.24 deprecates ragged array creation will now always raise a ValueError unless dtype=object is passed. This includes very deeply nested sequences. Previously, 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. will be thown.
Test case in test_multiclass.py, i.e. [np.array([]), np.array([1, 2, 3])], will raise AttributeError: 'list' object has no attribute 'array'
To Reproduce
To help us reproducing this bug, please provide information below:
Your Python version: v3.8.13
The version of Mars you use: master
Versions of crucial packages: numpy v1.24.1
Full stack of the error.
Minimized code to reproduce the error.
pytest mars/learn/utils/tests/test_multiclass.py::test_unique_labels_non_specific
or
import numpy as np
a = [np.array([]), np.array([1, 2, 3])]
np.asarray(a)
Expected behavior
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.
Additional context
Add any other context about the problem here.
Describe the bug Numpy 1.24 deprecates ragged array creation will now always raise a ValueError unless dtype=object is passed. This includes very deeply nested sequences. Previously, 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. will be thown. Test case in test_multiclass.py, i.e. [np.array([]), np.array([1, 2, 3])], will raise AttributeError: 'list' object has no attribute 'array'
To Reproduce To help us reproducing this bug, please provide information below:
pytest mars/learn/utils/tests/test_multiclass.py::test_unique_labels_non_specific or
Expected behavior 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.
Additional context Add any other context about the problem here.