Skip to content
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

REGR: pandas 1.2rc fails merge with AttributeError: 'bool' object has no attribute 'all' #38616

Closed
jorisvandenbossche opened this issue Dec 21, 2020 · 1 comment · Fixed by #38638
Labels
Regression Functionality that used to work in a prior pandas version Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Milestone

Comments

@jorisvandenbossche
Copy link
Member

From the dask test suite:

left = pd.DataFrame({"x": [1, 1], "z": ["foo", "foo"]})
right = pd.DataFrame({"x": [1, 1], "z": ["foo", "foo"]})

pd.merge(left, right, how="right", left_index=True, right_on="x")

This fails on master / 1.2.0rc:

In [18]: pd.merge(left, right, how="right", left_index=True, right_on="x")
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-18-94bf9fb575b1> in <module>
      2 right = pd.DataFrame({"x": [1, 1], "z": ["foo", "foo"]})
      3 
----> 4 pd.merge(left, right, how="right", left_index=True, right_on="x")

~/scipy/pandas/pandas/core/reshape/merge.py in merge(left, right, how, on, left_on, right_on, left_index, right_index, sort, suffixes, copy, indicator, validate)
     93         validate=validate,
     94     )
---> 95     return op.get_result()
     96 
     97 

~/scipy/pandas/pandas/core/reshape/merge.py in get_result(self)
    710             result = self._indicator_post_merge(result)
    711 
--> 712         self._maybe_add_join_keys(result, left_indexer, right_indexer)
    713 
    714         self._maybe_restore_index_levels(result)

~/scipy/pandas/pandas/core/reshape/merge.py in _maybe_add_join_keys(self, result, left_indexer, right_indexer)
    866                 if mask_left.all():
    867                     key_col = rvals
--> 868                 elif mask_right.all():
    869                     key_col = lvals
    870                 else:

AttributeError: 'bool' object has no attribute 'all'

@jorisvandenbossche jorisvandenbossche added Reshaping Concat, Merge/Join, Stack/Unstack, Explode Regression Functionality that used to work in a prior pandas version labels Dec 21, 2020
@jorisvandenbossche jorisvandenbossche added this to the 1.2 milestone Dec 21, 2020
simonjayhawkins added a commit to simonjayhawkins/pandas that referenced this issue Dec 22, 2020
@simonjayhawkins
Copy link
Member

This fails on master / 1.2.0rc:

first bad commit: [1c2de61] regression fix for merging DF with datetime index with empty DF (#36897)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Regression Functionality that used to work in a prior pandas version Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants