()
| 1700 | |
| 1701 | @pytest.mark.numpy |
| 1702 | def test_cast_integers_unsafe(): |
| 1703 | # We let NumPy do the unsafe casting. |
| 1704 | # Note that NEP50 in the NumPy spec no longer allows |
| 1705 | # the np.array() constructor to pass the dtype directly |
| 1706 | # if it results in an unsafe cast. |
| 1707 | unsafe_cases = [ |
| 1708 | (np.array([50000], dtype='i4'), 'int32', |
| 1709 | np.array([50000]).astype(dtype='i2'), pa.int16()), |
| 1710 | (np.array([70000], dtype='i4'), 'int32', |
| 1711 | np.array([70000]).astype(dtype='u2'), pa.uint16()), |
| 1712 | (np.array([-1], dtype='i4'), 'int32', |
| 1713 | np.array([-1]).astype(dtype='u2'), pa.uint16()), |
| 1714 | (np.array([50000], dtype='u2'), pa.uint16(), |
| 1715 | np.array([50000]).astype(dtype='i2'), pa.int16()) |
| 1716 | ] |
| 1717 | |
| 1718 | for case in unsafe_cases: |
| 1719 | _check_cast_case(case, safe=False) |
| 1720 | |
| 1721 | |
| 1722 | @pytest.mark.numpy |
nothing calls this directly
no test coverage detected