Skip to content

Commit 7a6ed6e

Browse files
committed
DOC: Update variables a and b to names consistent with comment documentation pandas-dev#60366
1 parent 318d878 commit 7a6ed6e

File tree

5 files changed

+20
-16
lines changed

5 files changed

+20
-16
lines changed

pandas/core/computation/eval.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,12 @@ def eval(
371371
is_extension_array_dtype(parsed_expr.terms.return_type)
372372
and not is_string_dtype(parsed_expr.terms.return_type)
373373
)
374-
or getattr(parsed_expr.terms, "operand_types", None) is not None
375-
and any(
376-
(is_extension_array_dtype(elem) and not is_string_dtype(elem))
377-
for elem in parsed_expr.terms.operand_types
374+
or (
375+
getattr(parsed_expr.terms, "operand_types", None) is not None
376+
and any(
377+
(is_extension_array_dtype(elem) and not is_string_dtype(elem))
378+
for elem in parsed_expr.terms.operand_types
379+
)
378380
)
379381
):
380382
warnings.warn(

pandas/core/computation/expr.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,7 @@ def _maybe_evaluate_binop(
512512
)
513513

514514
if self.engine != "pytables" and (
515-
res.op in CMP_OPS_SYMS
516-
and getattr(lhs, "is_datetime", False)
515+
(res.op in CMP_OPS_SYMS and getattr(lhs, "is_datetime", False))
517516
or getattr(rhs, "is_datetime", False)
518517
):
519518
# all date ops must be done in python bc numexpr doesn't work

pandas/core/computation/expressions.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def _where_numexpr(cond, left_op, right_op):
185185
local_dict={
186186
"cond_value": cond,
187187
"left_value": left_op,
188-
"right_value": right_op
188+
"right_value": right_op,
189189
},
190190
casting="safe",
191191
)
@@ -261,9 +261,11 @@ def where(cond, left_op, right_op, use_numexpr: bool = True):
261261
Whether to try to use numexpr.
262262
"""
263263
assert _where is not None
264-
return (_where(cond, left_op, right_op)
265-
if use_numexpr
266-
else _where_standard(cond, left_op, right_op))
264+
return (
265+
_where(cond, left_op, right_op)
266+
if use_numexpr
267+
else _where_standard(cond, left_op, right_op)
268+
)
267269

268270

269271
def set_test_mode(v: bool = True) -> None:

pandas/core/computation/pytables.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -408,11 +408,12 @@ def prune(self, klass):
408408
operand = operand.prune(klass)
409409

410410
if operand is not None and (
411-
issubclass(klass, ConditionBinOp)
412-
and operand.condition is not None
413-
or not issubclass(klass, ConditionBinOp)
414-
and issubclass(klass, FilterBinOp)
415-
and operand.filter is not None
411+
(issubclass(klass, ConditionBinOp) and operand.condition is not None)
412+
or (
413+
not issubclass(klass, ConditionBinOp)
414+
and issubclass(klass, FilterBinOp)
415+
and operand.filter is not None
416+
)
416417
):
417418
return operand.invert()
418419
return None

pandas/core/computation/scope.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class Scope:
140140
temps : dict
141141
"""
142142

143-
__slots__ = ["level", "scope", "target", "resolvers", "temps"]
143+
__slots__ = ["level", "resolvers", "scope", "target", "temps"]
144144
level: int
145145
scope: DeepChainMap
146146
resolvers: DeepChainMap

0 commit comments

Comments
 (0)