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

Function test_fill_null_array

python/pyarrow/tests/test_compute.py:2133–2150  ·  view source on GitHub ↗
(arrow_type)

Source from the content-addressed store, hash-verified

2131
2132@pytest.mark.parametrize('arrow_type', numerical_arrow_types)
2133def test_fill_null_array(arrow_type):
2134 arr = pa.array([1, 2, None, 4], type=arrow_type)
2135 fill_value = pa.scalar(5, type=arrow_type)
2136 result = arr.fill_null(fill_value)
2137 expected = pa.array([1, 2, 5, 4], type=arrow_type)
2138 assert result.equals(expected)
2139
2140 # Implicit conversions
2141 result = arr.fill_null(5)
2142 assert result.equals(expected)
2143
2144 # ARROW-9451: Unsigned integers allow this for some reason
2145 if not pa.types.is_unsigned_integer(arr.type):
2146 with pytest.raises((ValueError, TypeError)):
2147 arr.fill_null('5')
2148
2149 result = arr.fill_null(pa.scalar(5, type='int8'))
2150 assert result.equals(expected)
2151
2152
2153@pytest.mark.parametrize('arrow_type', numerical_arrow_types)

Callers

nothing calls this directly

Calls 3

equalsMethod · 0.80
arrayMethod · 0.45
scalarMethod · 0.45

Tested by

no test coverage detected