-
-
Notifications
You must be signed in to change notification settings - Fork 141
TYP: Series/DataFrame/Index are not Hashable #113
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
Conversation
…asses that have proper __hash__)
I cannot reproduce the dist failure of pyright: poetry run poe install_dist
poetry run poe rename_src
poetry run poe pyright_dist # no errors |
I looked in your log and saw this in the
So it may be that the caching you introduced is keeping around a version of |
Yes, that must be the case! Thank you for finding this! Let's just cache poetry.lock. |
MIght be a good idea to change |
ping when you want me to review the whole thing (and it's all green) |
Green and ready for review @Dr-Irv Caching just |
@@ -428,7 +431,7 @@ class DataFrame(NDFrame, OpsMixin): | |||
*, | |||
axis: Axis = ..., | |||
index: Hashable | Sequence[Hashable] = ..., | |||
columns: Hashable | Sequence[Hashable] = ..., | |||
columns: Hashable | Sequence[Hashable] | 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.
If Index
is now Hashable
, do you need to change this?
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.
Index
was declared to be Hashable
but it isn't.
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.
Index
probably needs to be added to many more annotations. Just added it here because a test was falling without it.
@@ -440,7 +443,7 @@ class DataFrame(NDFrame, OpsMixin): | |||
*, | |||
axis: Axis = ..., | |||
index: Hashable | Sequence[Hashable] = ..., | |||
columns: Hashable | Sequence[Hashable] = ..., | |||
columns: Hashable | Sequence[Hashable] | 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.
same as above. If Index
is now Hashable
, do you need to change this?
@@ -452,7 +455,7 @@ class DataFrame(NDFrame, OpsMixin): | |||
*, | |||
axis: Axis = ..., | |||
index: Hashable | Sequence[Hashable] = ..., | |||
columns: Hashable | Sequence[Hashable] = ..., | |||
columns: Hashable | Sequence[Hashable] | 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.
same as above. If Index
is now Hashable
, do you need to change this?
You could add a negative test to verify that these types are not def test_not_hashable():
def test_func(h: Hashable):
pass
test_func(pd.Series()) # type: ignore |
Added and green |
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 @twoertwein
assert_type()
to assert the type of any return value