MCPcopy Create free account
hub / github.com/apache/arrow / test_array_integer_object_nulls_option

Function test_array_integer_object_nulls_option

python/pyarrow/tests/test_pandas.py:1068–1084  ·  view source on GitHub ↗
(dtype)

Source from the content-addressed store, hash-verified

1066@pytest.mark.parametrize('dtype',
1067 ['i1', 'i2', 'i4', 'i8', 'u1', 'u2', 'u4', 'u8'])
1068def test_array_integer_object_nulls_option(dtype):
1069 num_values = 100
1070
1071 null_mask = np.random.randint(0, 10, size=num_values) < 3
1072 values = np.random.randint(0, 100, size=num_values, dtype=dtype)
1073
1074 array = pa.array(values, mask=null_mask)
1075
1076 if null_mask.any():
1077 expected = values.astype('O')
1078 expected[null_mask] = None
1079 else:
1080 expected = values
1081
1082 result = array.to_pandas(integer_object_nulls=True)
1083
1084 np.testing.assert_equal(result, expected)
1085
1086
1087@pytest.mark.parametrize('dtype',

Callers

nothing calls this directly

Calls 1

arrayMethod · 0.45

Tested by

no test coverage detected