Skip to content

TYP: Signature of "reindex" incompatible with supertype "NDFrame" #40984

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 17 commits into from
Nov 26, 2021

Conversation

MarcoGorelli
Copy link
Member

d = cast(
DataFrame,
concat(
[x.reindex(col_names, copy=False) for x in ldesc],
Copy link
Member Author

Choose a reason for hiding this comment

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

x.reindex(col_names, copy=False) was previously revealed to be of type Any. Now that it's typed, the result of concat is Frame | Series, so the cast is necessary

Copy link
Member

Choose a reason for hiding this comment

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

presumably at some point we'll overload concat s.t. axis=1 returns DataFrame, at which point this cast will be unnecessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, exactly!

Copy link
Member

@jbrockmendel jbrockmendel left a comment

Choose a reason for hiding this comment

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

LGTM

@MarcoGorelli MarcoGorelli requested a review from WillAyd April 27, 2021 20:22
@simonjayhawkins simonjayhawkins added the Typing type annotations, mypy/pyright type checking label Apr 28, 2021
Copy link
Member

@ivanovmg ivanovmg left a comment

Choose a reason for hiding this comment

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

Looks good to me

@MarcoGorelli MarcoGorelli requested a review from jreback May 3, 2021 16:28
@github-actions
Copy link
Contributor

github-actions bot commented Jun 3, 2021

This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Jun 3, 2021
@jreback
Copy link
Contributor

jreback commented Oct 4, 2021

still working?

@MarcoGorelli
Copy link
Member Author

Yes, ready for review

@jreback jreback added this to the 1.4 milestone Nov 26, 2021
@jreback jreback merged commit a164326 into pandas-dev:master Nov 26, 2021
@jreback
Copy link
Contributor

jreback commented Nov 26, 2021

thanks @MarcoGorelli

@MarcoGorelli MarcoGorelli deleted the align-reindex branch November 26, 2021 17:39
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.

TYP: Signature of "reindex" incompatible with supertype "NDFrame"
5 participants