Skip to content

TYP final _take_with_is_copy is overridden in series #40974

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

Closed
MarcoGorelli opened this issue Apr 16, 2021 · 2 comments · Fixed by #41004
Closed

TYP final _take_with_is_copy is overridden in series #40974

MarcoGorelli opened this issue Apr 16, 2021 · 2 comments · Fixed by #41004
Labels
good first issue Typing type annotations, mypy/pyright type checking

Comments

@MarcoGorelli
Copy link
Member

This method is declared as final:

pandas/pandas/core/generic.py

Lines 3629 to 3630 in 526d52f

@final
def _take_with_is_copy(self: FrameOrSeries, indices, axis=0) -> FrameOrSeries:

It's then overridden in series:

def _take_with_is_copy(self, indices, axis=0):

The reason mypy doesn't detect this failure is that the override in series in untyped, and so mypy doesn't check it


@jbrockmendel do you know which one is correct? Remove final or remove the override?

@MarcoGorelli MarcoGorelli added the Typing type annotations, mypy/pyright type checking label Apr 16, 2021
@jbrockmendel
Copy link
Member

i think remove the final

@1Riyad
Copy link

1Riyad commented Apr 17, 2021

Hi, I'm interested in contributing. Could I help to solve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants