You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: char.isnumeric returns True for empty strings (NumPy mismatch) #5243
Bug: char.isnumeric returns True for empty strings (NumPy mismatch)
Summary
arkouda.numpy.char.isnumeric does not match NumPy/Python semantics for empty strings.
Specifically, Arkouda returns True for "", while NumPy (np.char.isnumeric) and Python (str.isnumeric) return False.
This was discovered via a new NumPy-alignment verification test.
tests/numpy/alignment_verification/char_alignment.py::
TestArkoudaNumpyCharAlignment::test_isnumeric_matches_numpy_char
Mismatch at index 0:
value=''
got=True
expected=False
Root Cause (Likely)
The current implementation treats strings as numeric if all characters are numeric.
For empty strings, this condition is vacuously true, resulting in an incorrect True.
Proposed Fix
Update Strings.isnumeric() (or arkouda.numpy.char.isnumeric) to explicitly treat empty strings as non-numeric, matching NumPy semantics.
Conceptually:
isnumeric(s) = (len(s) > 0) AND all_characters_numeric(s)
Possible implementation:
AND the existing result with (self != ""), or
AND with (string_lengths > 0) if lengths are readily available.
Why This Matters
Aligns Arkouda string semantics with NumPy and Python
Prevents subtle downstream bugs in pandas/NumPy compatibility layers
Strengthens the new NumPy-alignment test suite
Environment
Arkouda client: 2025.12.16+
Arkouda server: 2025.12.16+ (minor version mismatch warning present but not believed to be causal)
Activity
Closes #5242: alignment tests for arkouda.numpy.char (#5244)