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

fix(python): Fix Series -> Expr dispatch for @property methods #5689

Merged
merged 1 commit into from
Dec 1, 2022

Conversation

stinodego
Copy link
Contributor

This is a bit of an ugly patch, but it was impossible to define a @property method on the Expr side. This is a workaround.

For context, I was trying to define an ordered property on the categorical namespace when I ran into this.

Overall I am not really happy with how the 'dispatching' worked out. The piece of code that takes care of it is too complicated for what it actually does. Anyway, that's a worry for another time, I guess.

@ritchie46
Copy link
Member

Not related to this PR, but touches the same topic:

I haven't really looked at the dispatch code myself. Now I see the loop. Do we loop trough all methods on every expression dispatch? Is this something we can cache?

@stinodego
Copy link
Contributor Author

Not related to this PR, but touches the same topic:

I haven't really looked at the dispatch code myself. Now I see the loop. Do we loop trough all methods on every expression dispatch? Is this something we can cache?

This only happens once, I believe it happens on import.

@ritchie46 ritchie46 changed the title Fix Series -> Expr dispatch for @property methods fix(python): Fix Series -> Expr dispatch for @property methods Dec 1, 2022
@ritchie46
Copy link
Member

Cool, thanks!

@github-actions github-actions bot added fix Bug fix python Related to Python Polars labels Dec 1, 2022
@ritchie46 ritchie46 merged commit d22178a into pola-rs:master Dec 1, 2022
@stinodego stinodego deleted the fix-dispatch branch February 22, 2023 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants