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

fixed mypy errors in mypy-pandas.tests.extension.decimal.test_decimal #31730

Conversation

SaturnFromTitan
Copy link
Contributor

Part of #28926

  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff

@SaturnFromTitan SaturnFromTitan force-pushed the 28926-fix-mypy-errors-for-pandas-tests-extension-decimal-test_decimal branch from eff526d to 8f13e39 Compare February 6, 2020 01:56
@@ -103,7 +105,7 @@ def assert_frame_equal(self, left, right, *args, **kwargs):
decimals = (left.dtypes == "decimal").index

for col in decimals:
self.assert_series_equal(left[col], right[col], *args, **kwargs)
BaseDecimal.assert_series_equal(left[col], right[col], *args, **kwargs)
Copy link
Member

Choose a reason for hiding this comment

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

this looks like it should be a classmethod

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What would be the advantage of using classmethod over staticmethod? I typically only use classmethod if I need multiple ways of instantiation

Copy link
Member

Choose a reason for hiding this comment

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

having BaseDecimal hard-coded here looks like a kludge, I'm speculating that what you want here is cls.assert_series_equal, kind of halfway inbetween the regular method it is now and the staticmethod in the PR

@WillAyd
Copy link
Member

WillAyd commented Feb 6, 2020

lgtm outside of @jbrockmendel comments

@WillAyd WillAyd added the Typing type annotations, mypy/pyright type checking label Feb 6, 2020
@jreback jreback added this to the 1.1 milestone Feb 9, 2020
@jreback jreback added ExtensionArray Extending pandas with custom dtypes or arrays. Testing pandas testing functions or related to the test suite labels Feb 9, 2020
@jreback jreback merged commit f04d913 into pandas-dev:master Feb 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ExtensionArray Extending pandas with custom dtypes or arrays. Testing pandas testing functions or related to the test suite Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants