TYP: implement typing.Manager2D #40853
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?)