Skip to content

DEPR: ExtensionOpsMixin in favor of OpsMixin #37080

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

Open
jbrockmendel opened this issue Oct 12, 2020 · 5 comments · Fixed by #38142
Open

DEPR: ExtensionOpsMixin in favor of OpsMixin #37080

jbrockmendel opened this issue Oct 12, 2020 · 5 comments · Fixed by #38142
Labels
Deprecate Functionality to remove in pandas

Comments

@jbrockmendel
Copy link
Member

All our internal uses have been moved over except for the DecimalArray tests, which use ExtensionScalarOpsMixin.

@jbrockmendel jbrockmendel added Bug Needs Triage Issue that has not been reviewed by a pandas team member Deprecate Functionality to remove in pandas and removed Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Oct 12, 2020
@jorisvandenbossche
Copy link
Member

The ExtensionScalarOpsMixin is not for internal use, it's for external use (so that fact that it's not used internally doesn't really matter, the question is what external users should do)

@jreback jreback added this to the 1.2 milestone Nov 29, 2020
@jorisvandenbossche jorisvandenbossche removed this from the 1.2 milestone Nov 29, 2020
@jorisvandenbossche
Copy link
Member

So this was originally added in #37080 by @Dr-Irv. As mentioned above, this class was not directly meant for internal use (we also didn't use it internally at that time), but to make it easier for external users to implement EAs.

It might be that we have thought of better ways now or that we think this is not actually needed, but in any case, the OpxMixin is not a direct replacement of the functionality provided by the ScalarOpsMixin.

@jbrockmendel
Copy link
Member Author

we could deprecated ExtensionOpsMixin and re-implement ScalarOpsMixin using OpsMixin instead of ExtensionOpsMixin

@jorisvandenbossche
Copy link
Member

That could be an option yes

@Dr-Irv
Copy link
Contributor

Dr-Irv commented Nov 30, 2020

See the docs here: https://pandas.pydata.org/docs/development/extending.html?highlight=extensionscalaropsmixin#extensionarray-operator-support

As long as the changes made support the second use case listed there (where the operators are already defined on the underlying individual scalar objects), I wouldn't have any major objections.

I should note that the PR #38142 (that was reverted in #38158) did not address the documentation issue referenced above, so I am glad to see that the deprecation suggestion is not part of pandas yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants