Skip to content

TYP: MergeHow + JoinHow #49664

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 9 commits into from
Dec 5, 2022
Merged

Conversation

debnathshoham
Copy link
Member

@debnathshoham debnathshoham added the Typing type annotations, mypy/pyright type checking label Nov 12, 2022
@debnathshoham debnathshoham marked this pull request as draft November 12, 2022 18:53
@debnathshoham debnathshoham marked this pull request as ready for review November 13, 2022 10:00
MergeHow = Literal["left", "right", "inner", "outer", "cross"]

# join
JoinHow = Literal["left", "right", "inner", "outer"]
Copy link
Member

Choose a reason for hiding this comment

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

Join supports cross as well

Copy link
Member Author

Choose a reason for hiding this comment

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

typed join with MergeHow.. used JoinHow for the indices.

I actually took this from pandas-stubs

https://github.com/pandas-dev/pandas-stubs/blob/db3b883dbe8d22863c8aca37c89431afce3b57e2/pandas-stubs/_typing.pyi#L299-L300

Copy link
Member

Choose a reason for hiding this comment

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

Could you check how they type DataFrame.join?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Yep

@phofl phofl added this to the 2.0 milestone Dec 5, 2022
@phofl phofl added the Reshaping Concat, Merge/Join, Stack/Unstack, Explode label Dec 5, 2022
@phofl phofl merged commit b2df890 into pandas-dev:main Dec 5, 2022
@phofl
Copy link
Member

phofl commented Dec 5, 2022

thx @debnathshoham

@debnathshoham debnathshoham deleted the gh48503_typehow branch December 5, 2022 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reshaping Concat, Merge/Join, Stack/Unstack, Explode Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ENH: .merge - specify string literals for .merge how keyword
2 participants