Skip to content

Commit

Permalink
FIX-modin-project#5203: don't raise AttributeError: 'list' object has…
Browse files Browse the repository at this point in the history
… no attribute '_query_compiler' in 'join' op

Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
  • Loading branch information
anmyachev committed Apr 5, 2023
1 parent f4bcefe commit 7e8bd35
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modin/pandas/dataframe.py
Expand Up @@ -41,6 +41,7 @@
import sys
from typing import IO, Optional, Union, Iterator, Hashable, Sequence
import warnings
from collections import abc

import modin
from modin.pandas import Categorical
Expand Down Expand Up @@ -1335,7 +1336,7 @@ def join(
"""
Join columns of another ``DataFrame``.
"""
if validate is not None:
if validate is not None or (on is not None and isinstance(other, abc.Iterable)):
return self._default_to_pandas(
pandas.DataFrame.join,
other,
Expand Down
11 changes: 11 additions & 0 deletions modin/pandas/test/dataframe/test_join_sort.py
Expand Up @@ -166,6 +166,17 @@ def test_join(test_data, test_data2):
df_equals(modin_join, pandas_join)


def test_join_5203():
df1 = pd.DataFrame(np.ones([2, 4]), columns=["a", "b", "c", "d"])
df2 = pd.DataFrame(np.ones([2, 4]), columns=["a", "b", "c", "d"])
df3 = pd.DataFrame(np.ones([2, 4]), columns=["a", "b", "c", "d"])
with pytest.raises(
ValueError,
match="Joining multiple DataFrames only supported for joining on index",
):
df1.join([df2, df3], how="inner", on="a")


@pytest.mark.parametrize(
"test_data, test_data2",
[
Expand Down

0 comments on commit 7e8bd35

Please sign in to comment.