百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
返回工具页/返回 Issues 列表
#7656·modin

BUG: modin.pandas.eval() 根本不起作用

作者: sfc-gh-mvashishtha创建于 2025年9月2日更新于 2025年9月9日
标签bug 🦗P2
python-traceback
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
File ~/miniconda3/envs/modin-dev/lib/python3.9/site-packages/pandas/core/computation/scope.py:236, in Scope.resolve(self, key, is_local)
    235     assert not is_local and not self.has_resolvers
--> 236     return self.scope[key]
    237 except KeyError:
File ~/miniconda3/envs/modin-dev/lib/python3.9/collections/__init__.py:941, in ChainMap.__getitem__(self, key)
    940         pass
--> 941 return self.__missing__(key)
File ~/miniconda3/envs/modin-dev/lib/python3.9/collections/__init__.py:933, in ChainMap.__missing__(self, key)
    932 def __missing__(self, key):
--> 933     raise KeyError(key)
KeyError: 'df'
During handling of the above exception, another exception occurred:
KeyError                                  Traceback (most recent call last)
File ~/miniconda3/envs/modin-dev/lib/python3.9/site-packages/pandas/core/computation/scope.py:242, in Scope.resolve(self, key, is_local)
    238 try:
    239     # last ditch effort we look in temporaries
    240     # these are created when parsing indexing expressions
    241     # e.g., df[df > 0]
--> 242     return self.temps[key]
    243 except KeyError as err:
KeyError: 'df'
The above exception was the direct cause of the following exception:
UndefinedVariableError                    Traceback (most recent call last)
Cell In[3], line 1
----> 1 pd.eval('df + 1')
File ~/sources/modin/modin/core/storage_formats/pandas/query_compiler_caster.py:1070, in wrap_function_in_argument_caster.<locals>.f_with_argument_casting(*args, **kwargs)
   1056 if len(input_backends) < 2 and (
   1057     not AutoSwitchBackend.get() or pin_target_backend is not None
   1058 ):
   1059     f_to_apply = _get_extension_for_method(
   1060         name=name,
   1061         extensions=extensions,
   (...)
   1068         wrapping_function_type=wrapping_function_type,
   1069     )
--> 1070     result = f_to_apply(*args, **kwargs)
   1071     if (
   1072         isinstance(result, QueryCompilerCaster)
   1073         and pin_target_backend is not None
   1074     ):
   1075
…

内容来源: modin-project/modin

查看 GitHub 原文在 GitHub 查看讨论