Skip to content
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

TYP: Type hints in merge incorrect for on #43215

Closed
phofl opened this issue Aug 25, 2021 · 1 comment
Closed

TYP: Type hints in merge incorrect for on #43215

phofl opened this issue Aug 25, 2021 · 1 comment
Labels
Closing Candidate May be closeable, needs more eyeballs Reshaping Concat, Merge/Join, Stack/Unstack, Explode Typing type annotations, mypy/pyright type checking

Comments

@phofl
Copy link
Member

phofl commented Aug 25, 2021

The type hints for merge

    on: IndexLabel | None = None,
    left_on: IndexLabel | None = None,
    right_on: IndexLabel | None = None,

imply that we pass keys here.

We have tests, which pass arrays as on argument, for example

test_handle_join_key_pass_array

Not sure if this is tested well...

related: #42844

@phofl phofl added Reshaping Concat, Merge/Join, Stack/Unstack, Explode Typing type annotations, mypy/pyright type checking labels Aug 25, 2021
@phofl phofl changed the title TYP: Type hints in merge for on incorrect TYP: Type hints in merge incorrect for on Aug 25, 2021
@twoertwein
Copy link
Member

I think this issue can be closed pd.merge uses IndexLabel | AnyArrayLike | None on main:

on: IndexLabel | AnyArrayLike | None = None,

(pandas-stubs also has a few tests for on* with arrays: https://github.com/pandas-dev/pandas-stubs/blob/072997b077ad4f766272e9bb2d03fc3771829270/tests/test_merge.py#L10 )

@twoertwein twoertwein added the Closing Candidate May be closeable, needs more eyeballs label Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closing Candidate May be closeable, needs more eyeballs Reshaping Concat, Merge/Join, Stack/Unstack, Explode Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

No branches or pull requests

3 participants