Skip to content

TYP: CallableDynamicDoc #46786

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
May 26, 2022
Merged

TYP: CallableDynamicDoc #46786

merged 6 commits into from
May 26, 2022

Conversation

twoertwein
Copy link
Member

The more tricky parts of #46698.

Adding type annotations to CallableDynamicDoc seems to uncover multiple missing type annotations. I'm not very confident in some of the new pyi files (types for cython/c functions).

@pep8speaks
Copy link

pep8speaks commented Apr 15, 2022

Hello @twoertwein! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2022-05-25 23:36:05 UTC

return self._handle_lowerdim_multi_index_axis0(tup)
# error "_LocationIndexer" has no attribute
# "_handle_lowerdim_multi_index_axis0"
return self._handle_lowerdim_multi_index_axis0( # type: ignore[attr-defined]
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 was about to make _LocationIndexer an abstract class but a sub-class (_iLocIndexer) does not implement _handle_lowerdim_multi_index_axis0 even though the class is being instantiated.

Copy link
Member Author

Choose a reason for hiding this comment

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

any ideas on how to make flake8&mypy&black accept this line (and the same line later in this file)?

Copy link
Member Author

Choose a reason for hiding this comment

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

using a cast to make flake8&mypy&black happy

@twoertwein twoertwein added the Typing type annotations, mypy/pyright type checking label May 6, 2022
@twoertwein twoertwein marked this pull request as ready for review May 8, 2022 01:36
@twoertwein
Copy link
Member Author

@jbrockmendel Could you have a look at json.pyi and indexing.py?

@jreback jreback added this to the 1.5 milestone May 8, 2022
@mroeschke mroeschke merged commit 3e3bb90 into pandas-dev:main May 26, 2022
@mroeschke
Copy link
Member

Thanks @twoertwein

@twoertwein twoertwein deleted the CallableDynamicDoc branch May 26, 2022 02:00
yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
* TYP: CallableDynamicDoc

* using cast

* tighten NDFrameIndexerBase

* dtype and clarification for _IndexingMixinT

Co-authored-by: Matthew Roeschke <[email protected]>
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.

5 participants