-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
DEPR: deprecate passing Series to Index.join #62948
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
Changes from 6 commits
58d0faa
a37e394
1040b40
50a0456
26c9959
0d254dd
90358b3
c67bf05
1702f50
91b3613
83205ac
c717289
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,6 +69,7 @@ | |
| from pandas.errors import ( | ||
| DuplicateLabelError, | ||
| InvalidIndexError, | ||
| Pandas4Warning, | ||
| ) | ||
| from pandas.util._decorators import ( | ||
| Appender, | ||
|
|
@@ -4426,6 +4427,15 @@ def join( | |
| (Index([1, 2, 3, 4, 5, 6], dtype='int64'), | ||
| array([ 0, 1, 2, -1, -1, -1]), array([-1, -1, -1, 0, 1, 2])) | ||
| """ | ||
| if not isinstance(other, Index): | ||
| warnings.warn( | ||
| f"Passing a Series to {type(self).__name__}.join is deprecated " | ||
|
||
| "and will raise in a future version. " | ||
| "Pass Index.join(other.index) instead.", | ||
| Pandas4Warning, | ||
| stacklevel=find_stack_level(), | ||
| ) | ||
|
|
||
| other = ensure_index(other) | ||
| sort = sort or how == "outer" | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you update this line to reflect that it is any non-Index and not just Series