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

Function test_replace_with_mask_basic

python/pyarrow/tests/test_compute.py:1305–1312  ·  view source on GitHub ↗

Test basic replacement with array mask.

()

Source from the content-addressed store, hash-verified

1303
1304
1305def test_replace_with_mask_basic():
1306 """Test basic replacement with array mask."""
1307 arr = pa.array([1, 2, 3, 4, 5])
1308 mask = pa.array([True, False, True, False, True])
1309 replacements = pa.array([10, 20, 30])
1310 expected = pa.array([10, 2, 20, 4, 30])
1311 result = pc.replace_with_mask(arr, mask, replacements)
1312 assert result.equals(expected)
1313
1314
1315def test_replace_with_mask_scalar_mask_true():

Callers

nothing calls this directly

Calls 2

equalsMethod · 0.80
arrayMethod · 0.45

Tested by

no test coverage detected