8000 Merge pull request #14341 from mattip/revert-13913 · numpy/numpy@dc7af64 · GitHub
[go: up one dir, main page]

Skip to content

Commit dc7af64

Browse files
authored
Merge pull request #14341 from mattip/revert-13913
BUG: revert detecting and raising error on ragged arrays
2 parents 4246ce2 + bc74b31 commit dc7af64

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

numpy/core/src/multiarray/ctors.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,13 +1849,6 @@ PyArray_GetArrayParamsFromObject(PyObject *op,
18491849
*out_arr = NULL;
18501850
return 0;
18511851
}
1852-
if (is_object && (requested_dtype != NULL) &&
1853-
(requested_dtype->type_num != NPY_OBJECT)) {
1854-
PyErr_SetString(PyExc_ValueError,
1855-
"cannot create an array from unequal-length (ragged) sequences");
1856-
Py_DECREF(*out_dtype);
1857-
return -1;
1858-
}
18591852
/* If object arrays are forced */
18601853
if (is_object) {
18611854
Py_DECREF(*out_dtype);

numpy/core/tests/test_multiarray.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
assert_, assert_raises, assert_warns, assert_equal, assert_almost_equal,
4545
assert_array_equal, assert_raises_regex, assert_array_almost_equal,
4646
assert_allclose, IS_PYPY, HAS_REFCOUNT, assert_array_less, runstring,
47-
temppath, suppress_warnings, break_cycles, assert_raises_regex,
47+
temppath, suppress_warnings, break_cycles,
4848
)
4949
from numpy.core.tests._locales import CommaDecimalPointLocale
5050

@@ -497,9 +497,6 @@ def test_array_cont(self):
497497
assert_(np.ascontiguousarray(d).flags.c_contiguous)
498498
assert_(np.asfortranarray(d).flags.f_contiguous)
499499

500-
def test_ragged(self):
501-
assert_raises_regex(ValueError, 'ragged',
502-
np.array, [[1], [2, 3]], dtype=int)
503500

504501
class TestAssignment(object):
505502
def test_assignment_broadcasting(self):

0 commit comments

Comments
 (0)
0