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

Fix mypy error messages in pandas/test/tseries/offsets/test_offsets.py #29340

Merged
merged 6 commits into from
Nov 7, 2019

Conversation

samuelsinayoko
Copy link
Contributor

Activate and fix mypy for test offsets

@simonjayhawkins simonjayhawkins added Typing type annotations, mypy/pyright type checking Testing pandas testing functions or related to the test suite labels Nov 2, 2019
@jbrockmendel
Copy link
Member

lgtm @simonjayhawkins

@simonjayhawkins simonjayhawkins changed the title 28926 mypy test toffsets 28926 mypy test_offsets.py Nov 2, 2019
@simonjayhawkins simonjayhawkins changed the title 28926 mypy test_offsets.py Fix mypy error messages in pandas/test/tseries/offsets/test_offsets.py Nov 2, 2019
@simonjayhawkins simonjayhawkins added this to the 1.0 milestone Nov 2, 2019
Copy link
Member

@simonjayhawkins simonjayhawkins left a comment

Choose a reason for hiding this comment

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

@samuelsinayoko Thanks for the PR. lgtm. @WillAyd

@@ -90,6 +90,7 @@ def test_to_M8():
#####
# DateOffset Tests
#####
_ApplyCases = List[Tuple[int, Dict[datetime, datetime]]]
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
_ApplyCases = List[Tuple[int, Dict[datetime, datetime]]]
_ApplyCases = List[Tuple[BaseOffset, Dict[datetime, datetime]]]

Kind of tricky but I don't think int is in play at all here but these are rather all BaseOffset subclasses.

This only "works" because there is no stub for pandas.tseries.offsets and all of the instances here resolve to Any. Assumedly if we stubbed that module it would cause failures if this stays as int

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point. Have just pushed this change.

@WillAyd WillAyd merged commit 4e945b6 into pandas-dev:master Nov 7, 2019
@WillAyd
Copy link
Member

WillAyd commented Nov 7, 2019

Great thanks @samuelsinayoko

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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