-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
TYP: define Index.any, Index.all non-dynamically #36929
TYP: define Index.any, Index.all non-dynamically #36929
Conversation
can you rebase |
False | ||
""" | ||
# FIXME: docstr inaccurate, args/kwargs not passed | ||
self._maybe_disable_logical_methods("any") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have a numpy validation routine for this and for all? eg. https://github.com/pandas-dev/pandas/blob/master/pandas/compat/numpy/function.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no
…p-31160-index-logical
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jbrockmendel generally lgtm
or is_float_dtype(self.dtype) | ||
): | ||
# This call will raise | ||
make_invalid_op(opname)(self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could this be done on the subclasses. more repetitive but would be easier to follow I think.
although, does disabling on subclasses obey LSP?
maybe a mixin that classes can opt into, to ensure that the base class or other code does not rely on any/all being available.
This would mean a base class for Index, to allow any/all on object Indexes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ATM we disable on subclasses (though by calling cls.add_disabled_whatever()
), and i thought it was clearer to do this in just one place, but if people disagree im fine with going the other direction.
I don't think it's that big a deal because I expect to change it before long since, as mentioned in the OP, i think several of the currently-disabled methods should be enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK with perhaps revisiting after some of the currently-disabled methods are enabled.
@jbrockmendel maybe open issues for these and @jreback comment #36929 (comment) |
Thanks @jbrockmendel |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
xref #31160, cc @simonjayhawkins
This unearths 2.5 issues:
1b) the RangeIndex methods don't have args/kwargs at all
self.categories
supports it