Skip to content

Commit

Permalink
DOC: Update warning message in pandas.eval function (pandas-dev#59108)
Browse files Browse the repository at this point in the history
* Update warning message in pandas.eval function

Modify warning to indicate the risks using eval func.

* Update pandas.eval function warning message - fix Docstring

* Update pandas/core/computation/eval.py

Co-authored-by: Matthew Roeschke <[email protected]>

* Update pandas/core/computation/eval.py

---------

Co-authored-by: Matthew Roeschke <[email protected]>
  • Loading branch information
eilonc-cx and mroeschke authored Jun 27, 2024
1 parent 10d3615 commit 0320b3c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pandas/core/computation/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,11 @@ def eval(
corresponding bitwise operators. :class:`~pandas.Series` and
:class:`~pandas.DataFrame` objects are supported and behave as they would
with plain ol' Python evaluation.
`eval` can run arbitrary code which can make you vulnerable to code
injection if you pass user input to this function.
.. warning::
``eval`` can run arbitrary code which can make you vulnerable to code
injection and untrusted data.
Parameters
----------
Expand Down

0 comments on commit 0320b3c

Please sign in to comment.