-
-
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
CLN: Type error fix in tests\tseries\offsets\test_yqm_offsets.py #28996
Conversation
The error is due to the fact that the builtins.staticmethod type defined in extension.base.base.BaseExtensionTests does not match the function type in extension.json.test_json.BaseJSON. I don't see a possibility for a type hint fix without changing the structure of the code. One way would be to replace the call of staticmethod by function definitions that call the corresponding methods. Here I propose an easier suppression of the error using type: Any. What do you think?
pandas/tests/extension/base/base.py
Outdated
import pandas.util.testing as tm | ||
|
||
|
||
class BaseExtensionTests: | ||
|
||
assert_equal = staticmethod(tm.assert_equal) | ||
assert_series_equal = staticmethod(tm.assert_series_equal) | ||
assert_frame_equal = staticmethod(tm.assert_frame_equal) | ||
assert_series_equal = staticmethod(tm.assert_series_equal) # type: Any |
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.
why is this needed?
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'm not clear on why these need to be staticmethods at all
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.
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.
Alright! Sorry for the mess. Still learning how this git really works ;) |
Merging master should fix the CI errors. |
Did I do something wrong? |
No, the 3.8 build is just flaky. I restarted it, so hopefully this will be green in a bit. |
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.
Great thanks @lukasbk |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff