Skip to content

Commit eb43fa4

Browse files
committed
Really truly fix it hopefully.
1 parent 7c4f625 commit eb43fa4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pandas/tests/extension/json/test_json.py

+11
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@ def dtype():
2121
@pytest.fixture
2222
def data():
2323
"""Length-100 PeriodArray for semantics test."""
24+
data = make_data()
25+
26+
# Why the while loop? NumPy is unable to construct an ndarray from
27+
# equal-length ndarrays. Many of our operations involve coercing the
28+
# EA to an ndarray of objects. To avoid random test failures, we ensure
29+
# that our data is coercable to an ndarray. Several tests deal with only
30+
# the first two elements, so that's what we'll check.
31+
32+
while len(data[0]) == len(data[1]):
33+
data = make_data()
34+
2435
return JSONArray(make_data())
2536

2637

0 commit comments

Comments
 (0)