Skip to content

TYP: implement typing.Manager2D #40853

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 2 commits into from
Apr 13, 2021
Merged

Conversation

jbrockmendel
Copy link
Member

Makes it feasible to annotate a Manager as specifically-2D, which I find makes it easier to reason about some of the groupby code.

@jorisvandenbossche any objection to a refactor of ArrayManager to make SingleArrayManager share a parent class with ArrayManager, but not subclass it? See https://github.com/pandas-dev/pandas/compare/master...jbrockmendel:typ-mgr-2d?expand=1#diff-80af4c7d6ece8cfeec6401a5f5babe27f19a7fc7476ad9148dca02f58a07a8dcR191

@simonjayhawkins the annotation for obj_with_exclusions https://github.com/pandas-dev/pandas/compare/master...jbrockmendel:typ-mgr-2d?expand=1#diff-f1ec980d06b0b54c8263f663f767636c3f5921f04f8a7ee91dfc71a2100b05cdR934 is a bit sketchy since it is a cache_readonly, not an attribute. Thoughts on how best to handle this? (Also, annotating it incorrectly as DataFrame in SeriesGroupBy doesn't get mypy to complain, which seems like it should?)

@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented Apr 9, 2021

any objection to a refactor of ArrayManager to make SingleArrayManager share a parent class with ArrayManager, but not subclass it

That sounds fine to me

@jbrockmendel jbrockmendel added the Typing type annotations, mypy/pyright type checking label Apr 12, 2021
@jreback jreback added this to the 1.3 milestone Apr 13, 2021
@jreback jreback added the Refactor Internal refactoring of code label Apr 13, 2021
@jreback jreback merged commit 75b647a into pandas-dev:master Apr 13, 2021
@jreback
Copy link
Contributor

jreback commented Apr 13, 2021

thanks!

@jbrockmendel jbrockmendel deleted the typ-mgr-2d branch April 13, 2021 14:17
JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor Internal refactoring of code Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants