-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
mypy typing issues for decimal pandas/tests/extension/decimal/test_decimal.py #28988
Conversation
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.
@yogendrasoni Thanks for the PR. A couple of suggestions.
[mypy-pandas.tests.extension.decimal.test_decimal] | ||
ignore_errors=True | ||
ignore_errors=False | ||
|
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.
can you remove this entire section from setup.cfg
@@ -110,35 +110,35 @@ def assert_frame_equal(self, left, right, *args, **kwargs): | |||
tm.assert_frame_equal(left, right, *args, **kwargs) | |||
|
|||
|
|||
class TestDtype(BaseDecimal, base.BaseDtypeTests): | |||
class TestDtype(BaseDecimal, base.BaseDtypeTests): # type: ignore |
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.
instead of silencing the mypy errors can you make the signatures of assert_series_equal
and assert_frame_equal
compatible between BaseDecimal
and BaseExtensionTests
.
make the methods in BaseDecimal
staticmethods and define the methods in BaseExtensionTests
to be compatibile using *args and **kwargs, i.e.
@staticmethod
def assert_series_equal(left, right, *args, **kwargs):
tm.assert_series_equal(left, right, *args, **kwargs)
@staticmethod
def assert_frame_equal(left, right, *args, **kwargs):
tm.assert_frame_equal(left, right, *args, **kwargs)
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.
tried putting staticmethod, BaseExtensionTests methods takes (left,right, some arguments) but BaseDecimal takes (left,right,*args,**kwargs) it is still showing incompatible by mypy, didn't find anything to solve this. I need to study more to solve 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.
I think #28994 has the same issue. What error are you getting after trying what @simonjayhawkins suggested?
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.
yes we have two modules that are reporting mypy errors due to the same root issue.
@simonjayhawkins am i right in thinking that the |
correct. |
@yogendrasoni is this still active? |
closing as stale, if you'ld like to continue, pls ping. |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff