-
Notifications
You must be signed in to change notification settings - Fork 162
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
Add static typing to labelers/data_processing.py #673
Add static typing to labelers/data_processing.py #673
Conversation
Head branch was pushed to by a user without write access
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 changes and a couple requests / questions
Head branch was pushed to by a user without write access
Co-authored-by: Taylor Turner <[email protected]>
@tonywu315 tests failing on 3.7 and 3.8 |
Head branch was pushed to by a user without write access
5c9675c
to
09c6302
Compare
@@ -74,6 +74,7 @@ def __eq__(self, other: BaseModel) -> bool: # type: ignore | |||
""" | |||
if ( | |||
type(self) != type(other) | |||
or not isinstance(other, BaseModel) |
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.
This theoretically should be covered by above, but does mypy get confused?
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 mypy thinks other
is still an object
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.
type(self) != type(other)
should validate that not isinstance(other, BaseDataProcessor)
would return True
. Just a redundant check. I'm fine with it --> better than #type: ignore
and casting IMO
dismissing my own review since I updated branch
if type(self) != type(other) or self._parameters != other._parameters: | ||
if ( | ||
type(self) != type(other) | ||
or not isinstance(other, BaseDataProcessor) |
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, another mypy confused?
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.
type(self) != type(other)
should validate that not isinstance(other, BaseDataProcessor)
would return True
. Just a redundant check
#609