Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

BUG: Raise TypeError when joining with non-DataFrame using 'on=' (GH#61434)#61454

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
iabhi4 wants to merge1 commit intopandas-dev:main
base:main
Choose a base branch
Loading
fromiabhi4:fix-61434-nonpandas-join-typeerror

Conversation

iabhi4
Copy link
Contributor

@iabhi4iabhi4 commentedMay 18, 2025
edited
Loading

Closes GH#61434

What does this PR change?

When usingDataFrame.join() with theon parameter, passing an invalid object like adict,int, or third-party DataFrame previously resulted in unclear internal errors.

This PR adds a minimal type check that raises a clearTypeError whenother is not aDataFrame,Series, or a list of such objects. Valid list-based joins withouton remain unaffected.

Checklist

@iabhi4iabhi4force-pushed thefix-61434-nonpandas-join-typeerror branch from78fbc2c tob604714CompareMay 19, 2025 00:26
@iabhi4
Copy link
ContributorAuthor

All checks passed except the Pyodide build, which failed due to a rate-limit (HTTP 429). The failure seems unrelated to this PR. A rerun should resolve it

@rhshadrachrhshadrach added ReshapingConcat, Merge/Join, Stack/Unstack, Explode Error ReportingIncorrect or improved errors from pandas labelsMay 19, 2025
@iabhi4iabhi4force-pushed thefix-61434-nonpandas-join-typeerror branch fromb604714 to71eb2e7CompareMay 19, 2025 05:19
@iabhi4iabhi4 requested a review fromrhshadrachMay 19, 2025 08:20
Comment on lines +10889 to +10891
if isinstance(other, Iterable) and not isinstance(
other, (DataFrame, Series, str, bytes, bytearray)
):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ifisinstance(other,Iterable)andnotisinstance(
other, (DataFrame,Series,str,bytes,bytearray)
):
ifis_list_like(other):

Copy link
Member

Choose a reason for hiding this comment

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

Also, this probably should be done inmerge

Copy link
Member

@rhshadrachrhshadrachMay 19, 2025
edited
Loading

Choose a reason for hiding this comment

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

@mroeschke - is_list_like will return True on a DataFrame. We only want to enter this block on a potential sequence of DataFrame/Series.

Copy link
Member

Choose a reason for hiding this comment

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

Ah OK ignore my suggestion then. But I believe this check should still be done inmerge probably

rhshadrach and iabhi4 reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Ah OK ignore my suggestion then. But I believe this check should still be done inmerge probably

ValueError is raised injoin() before the call reachesmerge whenon is specified. Would you prefer that I let these inputs flow intomerge and move the check there for consistency?

@iabhi4iabhi4force-pushed thefix-61434-nonpandas-join-typeerror branch from71eb2e7 to6789fb6CompareMay 22, 2025 21:18
@iabhi4iabhi4force-pushed thefix-61434-nonpandas-join-typeerror branch from6789fb6 toc9ac591CompareMay 22, 2025 21:23
@iabhi4iabhi4 requested a review fromrhshadrachMay 22, 2025 21:28
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@mroeschkemroeschkemroeschke left review comments

@rhshadrachrhshadrachAwaiting requested review from rhshadrach

Requested changes must be addressed to merge this pull request.

Assignees
No one assigned
Labels
Error ReportingIncorrect or improved errors from pandasReshapingConcat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

BUG: Joining Pandas with Polars dataframe produces fuzzy errormessage
3 participants
@iabhi4@mroeschke@rhshadrach

[8]ページ先頭

©2009-2025 Movatter.jp