Closed ion-elgreco closed 7 months ago
Passing a list(categorical) to a registered plugin expr will instantly kill the kernel:
Assume this simple expression
#[polars_expr(output_type=Float64)] fn test(inputs: &[Series]) -> PolarsResult<Series> { Ok(Series::from_vec("TEST", vec![0.0])) }
Then this plugin code:
@pl.api.register_expr_namespace("testing") class TestSpace: def __init__(self, expr: pl.Expr): self._expr = expr def test(self) -> pl.Expr: """test""" return self._expr.register_plugin( lib=lib, symbol="test", is_elementwise=True, )
Now exucting this expression on list(categorical) will faill.
df = pl.DataFrame( {"x": [["1"]],}, schema={"x": pl.List(pl.Categorical)}, ) df.with_columns( pl.col("x").testing.test(), )
However this runs fine:
df = pl.DataFrame( {"x": [["1"]]}, schema={"x": pl.List(pl.Utf8)}, ) df.with_columns( pl.col("x").dist_list.test(), ) shape: (1, 1) ┌─────┐ │ x │ │ --- │ │ f64 │ ╞═════╡ │ 0.0 │ └─────┘
Passing a list(categorical) to a registered plugin expr will instantly kill the kernel:
Assume this simple expression
Then this plugin code:
Now exucting this expression on list(categorical) will faill.
However this runs fine: