Skip to content
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

Merged

Conversation

tonywu315
Copy link
Contributor

@taylorfturner taylorfturner enabled auto-merge (squash) October 3, 2022 14:22
auto-merge was automatically disabled October 3, 2022 14:34

Head branch was pushed to by a user without write access

@taylorfturner taylorfturner enabled auto-merge (squash) October 3, 2022 14:39
Copy link
Contributor

@taylorfturner taylorfturner left a 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

dataprofiler/labelers/data_processing.py Outdated Show resolved Hide resolved
dataprofiler/labelers/data_processing.py Outdated Show resolved Hide resolved
dataprofiler/labelers/data_processing.py Outdated Show resolved Hide resolved
dataprofiler/labelers/data_processing.py Show resolved Hide resolved
dataprofiler/labelers/data_processing.py Outdated Show resolved Hide resolved
dataprofiler/tests/labelers/test_data_processing.py Outdated Show resolved Hide resolved
dataprofiler/labelers/data_processing.py Show resolved Hide resolved
dataprofiler/labelers/data_processing.py Show resolved Hide resolved
dataprofiler/labelers/data_processing.py Outdated Show resolved Hide resolved
auto-merge was automatically disabled October 4, 2022 18:33

Head branch was pushed to by a user without write access

@taylorfturner taylorfturner added the static_typing mypy static typing issues label Oct 5, 2022
@taylorfturner
Copy link
Contributor

@tonywu315 tests failing on 3.7 and 3.8

@taylorfturner taylorfturner enabled auto-merge (squash) October 6, 2022 20:33
auto-merge was automatically disabled October 6, 2022 20:54

Head branch was pushed to by a user without write access

@tonywu315 tonywu315 force-pushed the static_typing/labelers/processing branch from 5c9675c to 09c6302 Compare October 6, 2022 20:54
@taylorfturner taylorfturner enabled auto-merge (squash) October 6, 2022 20:56
@@ -74,6 +74,7 @@ def __eq__(self, other: BaseModel) -> bool: # type: ignore
"""
if (
type(self) != type(other)
or not isinstance(other, BaseModel)
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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

@taylorfturner taylorfturner dismissed their stale review October 6, 2022 21:00

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)
Copy link
Contributor

Choose a reason for hiding this comment

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

same, another mypy confused?

Copy link
Contributor

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

@taylorfturner taylorfturner merged commit 2e35ced into capitalone:main Oct 7, 2022
@tonywu315 tonywu315 deleted the static_typing/labelers/processing branch October 7, 2022 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
static_typing mypy static typing issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants