Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
naren-ponder opened this issue May 21, 2022 · 0 comments · May be fixed by #4529
Open

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

naren-ponder opened this issue May 21, 2022 · 0 comments · May be fixed by #4529
Labels
Code Quality 💯 Improvements or issues to improve quality of codebase P2 Minor bugs or low-priority feature requests

Comments

@naren-ponder
Copy link
Collaborator

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.

@mvashishtha mvashishtha added the Code Quality 💯 Improvements or issues to improve quality of codebase label May 27, 2022
@mvashishtha mvashishtha self-assigned this Jun 1, 2022
mvashishtha pushed a commit to mvashishtha/modin that referenced this issue Jun 6, 2022
@mvashishtha mvashishtha linked a pull request Jun 6, 2022 that will close this issue
8 tasks
@vnlitvinov vnlitvinov added the P2 Minor bugs or low-priority feature requests label Sep 6, 2022
@mvashishtha mvashishtha changed the title Remove hardcoding of local and global scopes for df.query and df.eval BUG: df.query and df.eval harcode level Mar 26, 2023
@mvashishtha mvashishtha removed their assignment May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Quality 💯 Improvements or issues to improve quality of codebase P2 Minor bugs or low-priority feature requests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants