Skip to content

BUG: df.query and df.eval harcode level #4478

Open
@naren-ponder

Description

@naren-ponder

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Code Quality 💯Improvements or issues to improve quality of codebaseP2Minor bugs or low-priority feature requests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions