Increase multidimensional testing for client_dtypes module
Increase multidimensional testing for client_dtypes module
In client_dtypes.py
- BitVector
Current: init takes any pdarray of ints and forwards values.ndim, values.shape up to ClientDType.
Problem: Will happily accept 2-D/3-D pdarray.
Tests: client_dtypes_test.py only covers 1-D creation, ops, round-trips. No tests for N-D rejection/behavior.
✅ Action: add if values.ndim != 1: raise ValueError(...) or add negative tests.
- Fields
Current: Similar to BitVector, calls super().init with values.ndim.
Problem: Will accept N-D.
Tests: Only 1-D coverage. No N-D tests.
✅ Action: same as above.
- IPv4
Current: Wraps integer pdarray, casts to uint32. No ndim restriction.
Problem: N-D allowed.
Tests: Only 1-D addresses. No N-D rejection tests.
✅ Action: enforce ndim == 1 or add tests.
- ip_address function
Current: wraps input into IPv4 (which accepts N-D).
Problem: by proxy, N-D is accepted.
Tests: only 1-D examples.
✅ Action: enforce or add tests.
- is_ipv4 / is_ipv6
Current: elementwise comparison of integer bit width. Accepts ip as pdarray or IPv4.
Problem: With 2-D pdarray, returns a flat or incorrectly shaped boolean array. Shape semantics not pinned.
Tests: only 1-D arrays tested.
✅ Action: either (a) add ndim == 1 guard, or (b) fix to preserve shape and add 2-D tests.
✅ Summary for client_dtypes
Functions/classes that need action because they allow N-D but aren’t guarded or tested:
BitVector.init
Fields.init
IPv4.init
ip_address
is_ipv4
is_ipv6