diff --git a/polars/polars-lazy/polars-plan/src/dsl/function_expr/fill_null.rs b/polars/polars-lazy/polars-plan/src/dsl/function_expr/fill_null.rs index cb9c39991249..0ba60976ab59 100644 --- a/polars/polars-lazy/polars-plan/src/dsl/function_expr/fill_null.rs +++ b/polars/polars-lazy/polars-plan/src/dsl/function_expr/fill_null.rs @@ -4,20 +4,16 @@ pub(super) fn fill_null(s: &[Series], super_type: &DataType) -> PolarsResult None: assert df.select(pl.col("a").cast(pl.UInt64).diff()).to_dict(False) == { "a": [None, -10, 20] } + + +@typing.no_type_check +def test_fill_null_unknown_output_type() -> None: + df = pl.DataFrame( + { + "a": [ + None, + 2, + 3, + 4, + 5, + ] + } + ) + assert df.with_columns( + np.exp(pl.col("a")).fill_null(pl.lit(1, pl.Float64)) + ).to_dict(False) == { + "a": [ + 1.0, + 7.38905609893065, + 20.085536923187668, + 54.598150033144236, + 148.4131591025766, + ] + }