Skip to content

Conversation

DavidKatz-il
Copy link
Contributor

Fix #6775

  • Tests added / passed
  • Passes black dask / flake8 dask

Copy link
Member

@jsignell jsignell left a comment

Choose a reason for hiding this comment

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

This looks great! Thanks for opening the PR!

@@ -4141,6 +4141,8 @@ def join(
npartitions=None,
shuffle=None,
):
if is_series_like(other) and hasattr(other, "name"):
other = other.to_frame()
Copy link
Member

Choose a reason for hiding this comment

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

It'd be nice to check for indexes here as well and convert those to dataframes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On Pandas it will cause an error. (join indexes only using concat)

>>> df = pd.DataFrame({"x": [1, 2, 3, 4, 5, 6, 7, 8]})
>>> df.join(df.index)

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-31-5499579ebbb6> in <module>
----> 1 df.join(df.index)

~\anaconda3\lib\site-packages\pandas\core\frame.py in join(self, other, on, how, lsuffix, rsuffix, sort)
   7206         5  K5  A5  NaN
   7207         """
-> 7208         return self._join_compat(
   7209             other, on=on, how=how, lsuffix=lsuffix, rsuffix=rsuffix, sort=sort
   7210         )

~\anaconda3\lib\site-packages\pandas\core\frame.py in _join_compat(self, other, on, how, lsuffix, rsuffix, sort)
   7240             frames = [self] + list(other)
   7241 
-> 7242             can_concat = all(df.index.is_unique for df in frames)
   7243 
   7244             # join indexes only using concat

~\anaconda3\lib\site-packages\pandas\core\frame.py in <genexpr>(.0)
   7240             frames = [self] + list(other)
   7241 
-> 7242             can_concat = all(df.index.is_unique for df in frames)
   7243 
   7244             # join indexes only using concat

AttributeError: 'int' object has no attribute 'index'

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! I guess this is good to go then :)

@jsignell
Copy link
Member

jsignell commented Nov 9, 2020

@dask/maintenance I don't have sufficient permissions to restart the travis job that timed out.

@martindurant
Copy link
Member

I don't seem to have the rerun burron anymore either :|
It's fine to push an empty commit to restart, a pity it will run all jobs.

@DavidKatz-il
Copy link
Contributor Author

I don't seem to have the rerun burron anymore either :|
It's fine to push an empty commit to restart, a pity it will run all jobs.

Sounds great, I will rebase on master and re-push.

@jsignell
Copy link
Member

jsignell commented Nov 9, 2020

I'll merge when green :)

@jsignell jsignell merged commit 554ca88 into dask:master Nov 10, 2020
@jsignell
Copy link
Member

Thanks for the PR @DavidKatz-il!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DataFrame.join doesn't accept Series as other
3 participants