Open
Description
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. What kind of performance improvements would you like to see with this new API?
For the pandas API functions df.query
and df.eval
, Modin hardcodes the function depth for local and global variable scopes. This is done in modin/pandas/dataframe.py
in the _update_var_dicts_in_kwargs
function:
f_locals = frame.f_back.f_back.f_back.f_locals
f_globals = frame.f_back.f_back.f_back.f_globals
Instead of this approach, Modin should support the levels
parameter in pandas.eval
(called by df.query
and df.eval
): https://pandas.pydata.org/docs/reference/api/pandas.eval.html#pandas.eval to create the local and global scopes.