Skip to content

Commit 091bc77

Browse files
rhshadrachgmcrocetti
authored andcommitted
DOC: Make warning on query/eval consistent (pandas-dev#60628)
1 parent ecbe77d commit 091bc77

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

pandas/core/computation/eval.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ def eval(
190190
191191
.. warning::
192192
193-
``eval`` can run arbitrary code which can make you vulnerable to code
194-
injection and untrusted data.
193+
This function can run arbitrary code which can make you vulnerable to code
194+
injection if you pass user input to this function.
195195
196196
Parameters
197197
----------

pandas/core/frame.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -4476,8 +4476,10 @@ def query(self, expr: str, *, inplace: bool = False, **kwargs) -> DataFrame | No
44764476
"""
44774477
Query the columns of a DataFrame with a boolean expression.
44784478
4479-
This method can run arbitrary code which can make you vulnerable to code
4480-
injection if you pass user input to this function.
4479+
.. warning::
4480+
4481+
This method can run arbitrary code which can make you vulnerable to code
4482+
injection if you pass user input to this function.
44814483
44824484
Parameters
44834485
----------
@@ -4634,6 +4636,11 @@ def eval(self, expr: str, *, inplace: bool = False, **kwargs) -> Any | None:
46344636
"""
46354637
Evaluate a string describing operations on DataFrame columns.
46364638
4639+
.. warning::
4640+
4641+
This method can run arbitrary code which can make you vulnerable to code
4642+
injection if you pass user input to this function.
4643+
46374644
Operates on columns only, not specific rows or elements. This allows
46384645
`eval` to run arbitrary code, which can make you vulnerable to code
46394646
injection if you pass user input to this function.

0 commit comments

Comments
 (0)