Skip to content

Commit 4986b31

Browse files
committed
CLN: parts of pandas-dev#29667
1 parent c79fc04 commit 4986b31

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

pandas/core/computation/eval.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from pandas.core.computation.engines import _engines
1313
from pandas.core.computation.expr import Expr, _parsers, tokenize_string
14-
from pandas.core.computation.scope import _ensure_scope
14+
from pandas.core.computation.scope import ensure_scope
1515

1616
from pandas.io.formats.printing import pprint_thing
1717

@@ -309,7 +309,7 @@ def eval(
309309
_check_for_locals(expr, level, parser)
310310

311311
# get our (possibly passed-in) scope
312-
env = _ensure_scope(
312+
env = ensure_scope(
313313
level + 1,
314314
global_dict=global_dict,
315315
local_dict=local_dict,

pandas/core/computation/pytables.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313

1414
import pandas as pd
1515
import pandas.core.common as com
16-
from pandas.core.computation import expr, ops
16+
from pandas.core.computation import expr, ops, scope as _scope
1717
from pandas.core.computation.common import _ensure_decoded
1818
from pandas.core.computation.expr import BaseExprVisitor
1919
from pandas.core.computation.ops import UndefinedVariableError, is_term
2020

2121
from pandas.io.formats.printing import pprint_thing, pprint_thing_encoded
2222

2323

24-
class Scope(expr.Scope):
24+
class Scope(_scope.Scope):
2525
__slots__ = ("queryables",)
2626

2727
def __init__(self, level, global_dict=None, local_dict=None, queryables=None):

pandas/core/computation/scope.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
from pandas.compat.chainmap import DeepChainMap
1717

1818

19-
def _ensure_scope(
20-
level, global_dict=None, local_dict=None, resolvers=(), target=None, **kwargs
21-
):
19+
def ensure_scope(
20+
level: int, global_dict=None, local_dict=None, resolvers=(), target=None, **kwargs
21+
) -> "Scope":
2222
"""Ensure that we are grabbing the correct scope."""
2323
return Scope(
2424
level + 1,
@@ -119,7 +119,7 @@ def __init__(
119119
self.scope.update(local_dict.scope)
120120
if local_dict.target is not None:
121121
self.target = local_dict.target
122-
self.update(local_dict.level)
122+
self._update(local_dict.level)
123123

124124
frame = sys._getframe(self.level)
125125

@@ -251,7 +251,7 @@ def _get_vars(self, stack, scopes):
251251
# scope after the loop
252252
del frame
253253

254-
def update(self, level: int):
254+
def _update(self, level: int):
255255
"""
256256
Update the current scope by going back `level` levels.
257257

0 commit comments

Comments
 (0)