-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TYP: annotate _data #29580
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: annotate _data #29580
Conversation
lgtm. @simonjayhawkins @WillAyd |
@@ -78,7 +78,7 @@ class DatetimeIndexOpsMixin(ExtensionOpsMixin): | |||
common ops mixin to support a unified interface datetimelike Index | |||
""" | |||
|
|||
_data = None |
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.
Were these solely set to None
before for annotation purposes? I think need to be careful in changing this if the intent was not solely for that purpose
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.
these were here pre-annotations, so I think it was so that the attribute always exists
@@ -230,7 +230,7 @@ def _outer_indexer(self, left, right): | |||
return libjoin.outer_join_indexer(left, right) | |||
|
|||
_typ = "index" | |||
_data = None | |||
_data: Union[ExtensionArray, np.ndarray] |
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.
you can now remove the assert and comment added in #29475 on L657?
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.
yes, updated
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.
updated+green
thanks @jbrockmendel |
NB: this does induce a small behavior change in that
Index
will not have a_data
attribute until__init__/__new__
.I found in #29561 that getting
_data
annotated is necessary before we can annotate most ofcore.indexes
.I'm also not sure what to do about MultiIndex, suggestions welcome.