diff --git a/vortex-python/python/vortex/polars_.py b/vortex-python/python/vortex/polars_.py index ff8df47fe9c..7fd0b240fef 100644 --- a/vortex-python/python/vortex/polars_.py +++ b/vortex-python/python/vortex/polars_.py @@ -172,6 +172,9 @@ def _polars_to_vortex(expr: dict[str, Any]) -> ve.Expr: if fn == "IsNotNull": return ve.is_not_null(_inputs[0]) + if fn == "IsNull": + return ve.is_null(_inputs[0]) + if "IsIn" in fn: fn = fn["IsIn"] if fn["nulls_equal"]: diff --git a/vortex-python/test/test_polars_.py b/vortex-python/test/test_polars_.py index 7d62722b38e..cf22a4fc900 100644 --- a/vortex-python/test/test_polars_.py +++ b/vortex-python/test/test_polars_.py @@ -182,3 +182,14 @@ def test_polars_binary_literals(tmp_path): actual = vx.open(str(path)).to_polars().filter(expr).collect() assert_frame_equal(actual, expected_frame) assert actual["id"].to_list() == [0] + + +def test_polars_is_null(tmp_path): + frame = pl.DataFrame({"id": [0, 1, 2], "x": [1, None, 3]}) + expr = pl.col("x").is_null() + path = tmp_path / "is_null.vortex" + vx.io.write(vx.array(frame.to_arrow()), str(path)) + expected_frame = frame.lazy().filter(expr).collect() + actual = vx.open(str(path)).to_polars().filter(expr).collect() + assert_frame_equal(actual, expected_frame) + assert actual["id"].to_list() == [1]