-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: fix tab completion #37173
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
BUG: fix tab completion #37173
Conversation
LGTM pending green |
I suppose worth a whatsnew note |
Updated. I´ve renamed _deprecations to _hidden_attribs, because being deprecated and hidden may be two different things. |
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.
lgtm, one tangential question.
_hidden_attrs = PandasObject._hidden_attrs | { | ||
"as_index", | ||
"axis", | ||
"dropna", |
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 want these to be hidden? Okay with keeping the same behavior as master in this PR, but maybe an issue should be opened.
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.
Good question. From a user perspective, I think it's ok to hide them (helps users focus on groupby methods), but I also think there are situation where we want them to be visible (when developing, advanced use cases).
Maybe store them as not-hidden internal attributes (_as_index
etc)?
@@ -489,6 +489,21 @@ def group_selection_context(groupby: "BaseGroupBy") -> Iterator["BaseGroupBy"]: | |||
class BaseGroupBy(PandasObject, SelectionMixin, Generic[FrameOrSeries]): | |||
_group_selection: Optional[IndexLabel] = None | |||
_apply_allowlist: FrozenSet[str] = frozenset() | |||
_hidden_attrs = PandasObject._hidden_attrs | { | |||
"as_index", |
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.
yeah can you differentiate between deprecations that we are hiding and attributes that we are hing for another reason (e.g. these are private)
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.
There may be deprecated attributes, that should not be hidden and vica versa. Also the deprecation log is in #30228, if we want to list deprecated attributes.
IMO it's ok to keep the concepts of hidden and deprecated attributes seperate.
thanks @topper-123 |
Currently tab completion doesn't work on attributes defined on the instance, only ones defined on the class. This fixes that.
Example:
Also some type fixups.