Skip to content

CLN: fix mypy errors in pandas/tests/extension/test_numpy.py #28926 #28947

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 3 commits into from
Oct 13, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions pandas/tests/extension/base/ops.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import operator
from typing import Type, Union

import pytest

Expand Down Expand Up @@ -61,10 +62,10 @@ class BaseArithmeticOpsTests(BaseOpsUtil):
* divmod_exc = TypeError
"""

series_scalar_exc = TypeError
frame_scalar_exc = TypeError
series_array_exc = TypeError
divmod_exc = TypeError
series_scalar_exc = TypeError # type: Union[Type[Exception], None]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
series_scalar_exc = TypeError # type: Union[Type[Exception], None]
series_scalar_exc = TypeError # type: Optional[Type[TypeError]]

I think we don't need to be more permissive on the error type here.

also, we tend to use Optional[<type>] instead of Union[<type>, None]

frame_scalar_exc = TypeError # type: Union[Type[Exception], None]
series_array_exc = TypeError # type: Union[Type[Exception], None]
divmod_exc = TypeError # type: Union[Type[Exception], None]

def test_arith_series_with_scalar(self, data, all_arithmetic_operators):
# series & scalar
Expand Down
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,6 @@ ignore_errors=True
[mypy-pandas.tests.extension.json.test_json]
ignore_errors=True

[mypy-pandas.tests.extension.test_numpy]
ignore_errors=True

[mypy-pandas.tests.extension.test_sparse]
ignore_errors=True

Expand Down