Skip to content

Commit 67bc9ec

Browse files
GH61405 PR feedback
1 parent 6457559 commit 67bc9ec

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

doc/source/whatsnew/v3.0.0.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,6 @@ Other API changes
401401
- Index set operations (like union or intersection) will now ignore the dtype of
402402
an empty ``RangeIndex`` or empty ``Index`` with object dtype when determining
403403
the dtype of the resulting Index (:issue:`60797`)
404-
- :meth:`DataFrame.query` does not accept ``**kwargs`` anymore and requires passing keywords for desired arguments (:issue:`61405`)
405404

406405
.. ---------------------------------------------------------------------------
407406
.. _whatsnew_300.deprecations:

pandas/core/frame.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4694,17 +4694,16 @@ def query(
46944694
if not isinstance(expr, str):
46954695
msg = f"expr must be a string to be evaluated, {type(expr)} given"
46964696
raise ValueError(msg)
4697-
kwargs: Any = {
4698-
"level": level + 1,
4699-
"target": None,
4700-
"parser": parser,
4701-
"engine": engine,
4702-
"local_dict": local_dict,
4703-
"global_dict": global_dict,
4704-
"resolvers": resolvers or (),
4705-
}
47064697

4707-
res = self.eval(expr, **kwargs)
4698+
res = self.eval(
4699+
expr,
4700+
level=level + 1,
4701+
parser=parser,
4702+
engine=engine,
4703+
local_dict=local_dict,
4704+
global_dict=global_dict,
4705+
resolvers=resolvers or (),
4706+
)
47084707

47094708
try:
47104709
result = self.loc[res]

0 commit comments

Comments
 (0)