Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork18.7k
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
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -10885,6 +10885,27 @@ def join( | ||||||||||
raise ValueError("Other Series must have a name") | ||||||||||
other = DataFrame({other.name: other}) | ||||||||||
if on is not None: | ||||||||||
if isinstance(other, Iterable) and not isinstance( | ||||||||||
other, (DataFrame, Series, str, bytes, bytearray) | ||||||||||
): | ||||||||||
Comment on lines +10889 to +10891 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Also, this probably should be done in Member
| ||||||||||
invalid = next( | ||||||||||
(obj for obj in other if not isinstance(obj, (DataFrame, Series))), | ||||||||||
None, | ||||||||||
) | ||||||||||
if invalid is not None: | ||||||||||
raise TypeError( | ||||||||||
f"Join with 'on={on}' requires a pandas DataFrame or Series, " | ||||||||||
"or an iterable of such objects as 'other'. Got an " | ||||||||||
f"invalid element of type {type(invalid).__name__} instead." | ||||||||||
) | ||||||||||
elif not isinstance(other, (DataFrame, Series)): | ||||||||||
raise TypeError( | ||||||||||
f"Join with 'on={on}' requires a pandas DataFrame or Series as " | ||||||||||
"'other'. Got " | ||||||||||
f"{type(other).__name__} instead." | ||||||||||
) | ||||||||||
if isinstance(other, DataFrame): | ||||||||||
if how == "cross": | ||||||||||
return merge( | ||||||||||
Uh oh!
There was an error while loading.Please reload this page.