Skip to content

Commit d273ee0

Browse files
authored
CI: Backport changes to fix unreliable tests on ARM (pandas-dev#53849)
1 parent 5299051 commit d273ee0

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

pandas/tests/frame/indexing/test_setitem.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class mystring(str):
6161
"dtype", ["int32", "int64", "uint32", "uint64", "float32", "float64"]
6262
)
6363
def test_setitem_dtype(self, dtype, float_frame):
64-
arr = np.random.randn(len(float_frame))
64+
arr = np.random.randint(1, 10, len(float_frame))
6565

6666
float_frame[dtype] = np.array(arr, dtype=dtype)
6767
assert float_frame[dtype].dtype.name == dtype

pandas/tests/series/methods/test_nlargest.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,12 @@ def test_nlargest_boolean(self, data, expected):
217217
def test_nlargest_nullable(self, any_numeric_ea_dtype):
218218
# GH#42816
219219
dtype = any_numeric_ea_dtype
220-
arr = np.random.randn(10).astype(dtype.lower(), copy=False)
220+
if dtype.startswith("UInt"):
221+
# Can't cast from negative float to uint on some platforms
222+
arr = np.random.randint(1, 10, 10)
223+
else:
224+
arr = np.random.randn(10)
225+
arr = arr.astype(dtype.lower(), copy=False)
221226

222227
ser = Series(arr.copy(), dtype=dtype)
223228
ser[1] = pd.NA

0 commit comments

Comments
 (0)