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

call __finalize__ in DataFrame.eval with engine=numexpr #52888

Closed
wants to merge 5 commits into from

Conversation

jiawei-zhang-a
Copy link
Contributor

@jiawei-zhang-a jiawei-zhang-a commented Apr 24, 2023

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

The goal here is to make progress on #28283.

@mroeschke mroeschke added metadata _metadata, .attrs expressions pd.eval, query labels Apr 24, 2023
@mroeschke
Copy link
Member

Thanks. Could you address the unit test failures?

@jiawei-zhang-a
Copy link
Contributor Author

Sure no problem, I will try to fix this problem

@jiawei-zhang-a
Copy link
Contributor Author

@mroeschke Hi Mr.Roeschke, I have added a special judge when it is not DataFrame and does have attr __finalize__

pandas/core/frame.py Outdated Show resolved Hide resolved
@jiawei-zhang-a
Copy link
Contributor Author

Now inplace is and engine are involved to successfully call finalize

# Extract the engine from kwargs or use the default value "numexpr"
engine = kwargs.get("engine")

if engine == "numexpr" and inplace is False:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix this in _eval instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! I will do that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mroeschke Mr. Roeschke, I am sorry I tried but failed to move it to the eval in _eval, would you mind giving me some suggestions, please? I would very much appreciate it

@github-actions
Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label May 29, 2023
@mroeschke
Copy link
Member

Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.

@mroeschke mroeschke closed this May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
expressions pd.eval, query metadata _metadata, .attrs Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants