-
-
Notifications
You must be signed in to change notification settings - Fork 12.2k
BUG: FreeBSD fails a conversion test #28351
Copy link
Copy link
Closed
Description
FreeBSD recently began failing the test_nested_arrays_stringlength test in test_array_coercion.py. It emits a RuntimeWarning when casting float objects to string dtype
self = <test_array_coercion.TestStringDiscovery object at 0x1a16d2f95dd0>
obj = 1.2
@pytest.mark.parametrize("obj",
[object(), 1.2, 10**43, None, "string"],
ids=["object", "1.2", "10**43", "None", "string"])
def test_nested_arrays_stringlength(self, obj):
length = len(str(obj))
expected = np.dtype(f"S{length}")
arr = np.array(obj, dtype="O")
> assert np.array([arr, arr], dtype="S").dtype == expected
E RuntimeWarning: invalid value encountered in cast
arr = array(1.2, dtype=object)
expected = dtype('S3')
length = 3
obj = 1.2
self = <test_array_coercion.TestStringDiscovery object at 0x1a16d2f95dd0>
../.venv/lib/python3.11/site-packages/numpy/_core/tests/test_array_coercion.py:180: RuntimeWarning
Maybe we could get some FreeBSD eyeballs on this, I don't know who we should ping. I see @oscargus and @DavidAlphaFox have previously contributed FreeBSD issues and PRs, maybe they know who to turn to? In any case, #28331 makes CI pass by checking that this warning is emitted. This issue is to remind us to try to fix it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels