From d4d4bcc05acb4e1b56d46276260e119553ede46b Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Tue, 5 Nov 2024 07:46:35 -0500 Subject: [PATCH] fix(polars): ensure that null literals are not mistakenly made non-null --- ibis/backends/polars/compiler.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ibis/backends/polars/compiler.py b/ibis/backends/polars/compiler.py index 34c2fb83acdb..04c8a8cc928d 100644 --- a/ibis/backends/polars/compiler.py +++ b/ibis/backends/polars/compiler.py @@ -82,6 +82,9 @@ def literal(op, **_): value = op.value dtype = op.dtype + if value is None: + return pl.lit(None, dtype=PolarsType.from_ibis(dtype)) + if dtype.is_array(): value = pl.Series("", value) typ = PolarsType.from_ibis(dtype)