Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(python): Add security warning in LazyFrame.deserialize() docstring #15282

Merged
merged 2 commits into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions py-polars/polars/expr/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions py-polars/polars/lazyframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,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
Expand Down
Loading