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

Function test_drop_null_table

python/pyarrow/tests/test_compute.py:1605–1631  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1603
1604
1605def test_drop_null_table():
1606 table = pa.table([pa.array(["a", None, "c", "d", None])], names=["a"])
1607 expected = pa.table([pa.array(["a", "c", "d"])], names=["a"])
1608 result = table.drop_null()
1609 assert result.equals(expected)
1610
1611 table = pa.table([pa.chunked_array([["a", None], ["c", "d", None]]),
1612 pa.chunked_array([["a", None], [None, "d", None]]),
1613 pa.chunked_array([["a"], ["b"], [None], ["d", None]])],
1614 names=["a", "b", "c"])
1615 expected = pa.table([pa.array(["a", "d"]),
1616 pa.array(["a", "d"]),
1617 pa.array(["a", "d"])],
1618 names=["a", "b", "c"])
1619 result = table.drop_null()
1620 assert result.equals(expected)
1621
1622 table = pa.table([pa.chunked_array([["a", "b"], ["c", "d", "e"]]),
1623 pa.chunked_array([["A"], ["B"], [None], ["D", None]]),
1624 pa.chunked_array([["a`", None], ["c`", "d`", None]])],
1625 names=["a", "b", "c"])
1626 expected = pa.table([pa.array(["a", "d"]),
1627 pa.array(["A", "D"]),
1628 pa.array(["a`", "d`"])],
1629 names=["a", "b", "c"])
1630 result = table.drop_null()
1631 assert result.equals(expected)
1632
1633
1634def test_drop_null_null_type():

Callers

nothing calls this directly

Calls 3

equalsMethod · 0.80
chunked_arrayMethod · 0.80
arrayMethod · 0.45

Tested by

no test coverage detected