Skip to content

TYPING : Series.name -> Optional[Hashable] #29164

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

Merged
merged 2 commits into from
Oct 22, 2019

Conversation

simonjayhawkins
Copy link
Member

@simonjayhawkins simonjayhawkins added the Typing type annotations, mypy/pyright type checking label Oct 22, 2019
@simonjayhawkins simonjayhawkins added this to the 1.0 milestone Oct 22, 2019
@WillAyd
Copy link
Member

WillAyd commented Oct 22, 2019

No problem with changing but what caused this issue exactly? Something we need to account for with pickle compat?

@@ -926,7 +927,7 @@ def aggregate(self, func=None, *args, **kwargs):

agg = aggregate

def _iterate_slices(self) -> Iterable[Tuple[Hashable, Series]]:
def _iterate_slices(self) -> Iterable[Tuple[Optional[Hashable], Series]]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note there is a similar definition for SeriesGroupBy - not sure if that needs to change as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe IndexLabel = Optional[Hashable] in _typing.py

@simonjayhawkins
Copy link
Member Author

No problem with changing but what caused this issue exactly? Something we need to account for with pickle compat?

no. with check_untyped_defs (i.e. checks body of _unpickle_series_compat)..

None is assigned to name: index, name = own_state[0], None

and then assigned to self.name: self.name = name

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@TomAugspurger TomAugspurger merged commit bef9bae into pandas-dev:master Oct 22, 2019
@TomAugspurger
Copy link
Contributor

Thanks!

@simonjayhawkins simonjayhawkins deleted the hashable branch October 23, 2019 09:28
HawkinsBA pushed a commit to HawkinsBA/pandas that referenced this pull request Oct 29, 2019
* TYPING : Series.name -> Optional[Hashable]
Reksbril pushed a commit to Reksbril/pandas that referenced this pull request Nov 18, 2019
* TYPING : Series.name -> Optional[Hashable]
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
* TYPING : Series.name -> Optional[Hashable]
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
* TYPING : Series.name -> Optional[Hashable]
bongolegend pushed a commit to bongolegend/pandas that referenced this pull request Jan 1, 2020
* TYPING : Series.name -> Optional[Hashable]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants