Skip to content

TYP: handle mypy ignore in pandas/_testing #38236

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 6 commits into from
Dec 19, 2020

Conversation

ivanovmg
Copy link
Member

@ivanovmg ivanovmg commented Dec 2, 2020

Handle mypy ignore comments in pandas/_testing.py, function write_to_compressed.

@ivanovmg
Copy link
Member Author

ivanovmg commented Dec 2, 2020

It's green, except failing TestHDFStore.test_append_with_data_columns on Linux py39.

compress_method = get_lzma_file(lzma)
else:
raise ValueError(f"Unrecognized compression type: {compression}")
compress_method = _select_compress_method(compression)
Copy link
Contributor

Choose a reason for hiding this comment

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

i think you could leave this inline and just type compress_method no?

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess so.
I just thought that some small function extraction will be helpful here.
But if you suggest against the extraction, I can definitely do that way as well.

Copy link
Member

Choose a reason for hiding this comment

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

I would prefer for this to stay inline as well

Copy link
Member Author

Choose a reason for hiding this comment

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

I inlined the function and also slid the conditionals. Can revert if this is not what you expect, but in my opinion, it simplifies the understanding that zip has a different signature as compared to other compression methods.

@jreback jreback added the Typing type annotations, mypy/pyright type checking label Dec 4, 2020
@ivanovmg ivanovmg requested review from WillAyd and jreback December 18, 2020 11:16
@jreback jreback added this to the 1.3 milestone Dec 19, 2020
@jreback jreback merged commit e06fbbe into pandas-dev:master Dec 19, 2020
luckyvs1 pushed a commit to luckyvs1/pandas that referenced this pull request Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants