Skip to content

TYP: Adjust typing for Blockplacement.__getitem__ #51036

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 3 commits into from
Feb 1, 2023

Conversation

phofl
Copy link
Member

@phofl phofl commented Jan 28, 2023

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

cc @jbrockmendel

I might be missing something, but an array should be valid as well

@phofl phofl added Internals Related to non-user accessible pandas implementation Typing type annotations, mypy/pyright type checking labels Jan 28, 2023
@@ -44,7 +44,9 @@ class BlockPlacement:
@property
def is_slice_like(self) -> bool: ...
@overload
def __getitem__(self, loc: slice | Sequence[int]) -> BlockPlacement: ...
def __getitem__(
Copy link
Member

Choose a reason for hiding this comment

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

can the ndarray be made more specifically np.intp? in particular im thinking ruling out bool

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, updated

@jbrockmendel jbrockmendel merged commit dbe5927 into pandas-dev:main Feb 1, 2023
@jbrockmendel
Copy link
Member

thanks @phofl

@phofl phofl deleted the typing_block_placement branch February 1, 2023 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internals Related to non-user accessible pandas implementation Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants