diff --git a/py-polars/polars/expr/expr.py b/py-polars/polars/expr/expr.py index 357be09e5044..15eae731fbfd 100644 --- a/py-polars/polars/expr/expr.py +++ b/py-polars/polars/expr/expr.py @@ -344,6 +344,13 @@ def deserialize(cls, source: str | Path | IOBase) -> Self: objects that have a `read()` method, such as a file handler (e.g. via builtin `open` function) or `BytesIO`). + Warnings + -------- + This function uses :mod:`pickle` under some circumstances, and as + such inherits the security implications. Deserializing can execute + arbitrary code so it should only be attempted on trusted data. + pickle is only used when the logical plan contains python UDFs. + See Also -------- Expr.meta.serialize diff --git a/py-polars/polars/lazyframe/frame.py b/py-polars/polars/lazyframe/frame.py index 688ef8d40c54..9d3e521a807c 100644 --- a/py-polars/polars/lazyframe/frame.py +++ b/py-polars/polars/lazyframe/frame.py @@ -357,6 +357,14 @@ def deserialize(cls, source: str | Path | IOBase) -> Self: objects that have a `read()` method, such as a file handler (e.g. via builtin `open` function) or `BytesIO`). + Warnings + -------- + This function uses :mod:`pickle` under some circumstances, and as + such inherits the security implications. Deserializing can execute + arbitrary code so it should only be attempted on trusted data. + pickle is only used when the logical plan contains python UDFs. + + See Also -------- LazyFrame.serialize