Skip to content

Commit ef686a0

Browse files
author
Alexander Lakeev
committed
BUG: Fix eval's empty scopes not working
1 parent 1be9d38 commit ef686a0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/core/computation/scope.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ def __init__(
133133
# shallow copy here because we don't want to replace what's in
134134
# scope when we align terms (alignment accesses the underlying
135135
# numpy array of pandas objects)
136-
scope_global = self.scope.new_child((global_dict or frame.f_globals).copy())
136+
scope_global = self.scope.new_child((global_dict if global_dict is not None else frame.f_globals).copy())
137137
self.scope = DeepChainMap(scope_global)
138138
if not isinstance(local_dict, Scope):
139139
scope_local = self.scope.new_child(
140-
(local_dict or frame.f_locals).copy()
140+
(local_dict if local_dict is not None else frame.f_locals).copy()
141141
)
142142
self.scope = DeepChainMap(scope_local)
143143
finally:

0 commit comments

Comments
 (0)