-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Update join docs for other param #46850
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
Conversation
Update join docs regarding using multiple Series
No idea why this is failing 🤷 |
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.
Thanks for the PR! Are iterables of Series tested? If not, can you add a test for them.
This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this. |
@multimeric - are you interested in continuing this? |
Hmm, I'm a bit stuck. I can't work out how to get mypy to understand it's working with a list of |
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 post the mypy issues you're seeing?
|
It's not clear to me what type signature is causing this to fail. Even if I type cast it I'm still getting the same error. |
I think the line should be:
|
Thanks, that fixed it. Indeed I didn't try casting both parts of the concatenation, partly because I would have thought mypy could have narrowed the type of |
@multimeric can you merge master into your branch, seems like the problem in the CI is unrelated. |
I actually did that just before. It looks like the current failure is just a timeout? Happy to pull again though. |
No, there is indeed a failure here. But it seems unrelated entirely. |
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.
pandas/core/frame.py
Outdated
@@ -9582,7 +9582,7 @@ def join( | |||
|
|||
Parameters | |||
---------- | |||
other : DataFrame, Series, or list of DataFrame | |||
other : DataFrame, Series, or list of either of these |
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.
I think this should say "or list of DataFrames, Series, or both". "Either of these" implies that it has to be all one type.
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.
I went with "or a list containing any combination of DataFrames and Series", if that's okay
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.
One small thing to comment on cast
This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this. |
@multimeric do you have time to add the requested comment? And ir'd also be good if you can merge master into your branch @rhshadrach I think your comments were addressed, can you check if this is ready from your side? |
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.
lgtm
pandas/core/frame.py
Outdated
@@ -9805,7 +9805,8 @@ def join( | |||
|
|||
Parameters | |||
---------- | |||
other : DataFrame, Series, or list of DataFrame | |||
other : DataFrame, Series, or a list containing any combination of DataFrames | |||
and Series. |
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.
code checks build is failing with
Error: /home/runner/work/pandas/pandas/pandas/core/frame.py:9789:PR08:pandas.DataFrame.join:Parameter "other" description should start with a capital letter
I think it's confused by the period here; hopefully removing it should resolve.
pandas/core/frame.py
Outdated
other : DataFrame, Series, or a list containing any combination of DataFrames | ||
and Series |
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.
I see it now; the linter is complaining about the "and" being lowercase as if it's the start the description. I'd hazard a guess that sphinx does too. I think we should make the type more consise:
DataFrame, Series, or a list of any combination of these
Thanks @multimeric for your persistence and all for the review! |
Currently the
DataFrame.join
docs imply that the type ofother
isDataFrame | Series | list[DataFrame]
, but this is not correct, andlist[Series | DataFrame]
is a more appropriate type.The type signature and also the method description have been updated to amend this.
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.