Repository: modin-project/modin

Issue:
BUG: join raises `AttributeError: 'list' object has no attribute '_query_compiler'`
### Modin version checks

- [X] I have checked that this issue has not already been reported.

- [X] I have confirmed this bug exists on the latest released version of Modin.

- [X] I have confirmed this bug exists on the main branch of Modin. (In order to do this you can follow [this guide](https://modin.readthedocs.io/en/stable/getting_started/installation.html#installing-from-the-github-master-branch).)


### Reproducible Example

```python
import modin.pandas as pd
import numpy as np

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'])

df1.join([df2, df3], how="inner", on="a")
```


### Issue Description

Non-obvious error message. 

### Expected Behavior

In that case we should raise `ValueError: Joining multiple DataFrames only supported for joining on index` exception as pandas does.

### Error Logs

<details>

```python-traceback

File "test_join.py", line 8, in <module>
    df1.join([df2, df3], how="inner", on="a")
  File "C:\projects\modin\modin\logging\logger_decorator.py", line 128, in run_and_log
    return obj(*args, **kwargs)
  File "C:\projects\modin\modin\_compat\pandas_api\latest\dataframe.py", line 172, in join
    return self._join(
  File "C:\projects\modin\modin\logging\logger_decorator.py", line 128, in run_and_log
    return obj(*args, **kwargs)
  File "C:\projects\modin\modin\pandas\dataframe.py", line 1321, in _join
    other._query_compiler,
AttributeError: 'list' object has no attribute '_query_compiler'

```

</details>


### Installed Versions

<details>

Replace this line with the output of pd.show_versions()

</details>



Discussion:

Resolving patch:
diff --git a/modin/pandas/dataframe.py b/modin/pandas/dataframe.py
--- a/modin/pandas/dataframe.py
+++ b/modin/pandas/dataframe.py
@@ -1335,6 +1335,10 @@ def join(
         """
         Join columns of another ``DataFrame``.
         """
+        if on is not None and not isinstance(other, (Series, DataFrame)):
+            raise ValueError(
+                "Joining multiple DataFrames only supported for joining on index"
+            )
         if validate is not None:
             return self._default_to_pandas(
                 pandas.DataFrame.join,


Test patch:
diff --git a/modin/pandas/test/dataframe/test_join_sort.py b/modin/pandas/test/dataframe/test_join_sort.py
--- a/modin/pandas/test/dataframe/test_join_sort.py
+++ b/modin/pandas/test/dataframe/test_join_sort.py
@@ -166,6 +166,21 @@ def test_join(test_data, test_data2):
         df_equals(modin_join, pandas_join)
 
 
+def test_join_5203():
+    data = np.ones([2, 4])
+    kwargs = {"columns": ["a", "b", "c", "d"]}
+    modin_dfs, pandas_dfs = [None] * 3, [None] * 3
+    for idx in range(len(modin_dfs)):
+        modin_dfs[idx], pandas_dfs[idx] = create_test_dfs(data, **kwargs)
+
+    for dfs in (modin_dfs, pandas_dfs):
+        with pytest.raises(
+            ValueError,
+            match="Joining multiple DataFrames only supported for joining on index",
+        ):
+            dfs[0].join([dfs[1], dfs[2]], how="inner", on="a")
+
+
 @pytest.mark.parametrize(
     "test_data, test_data2",
     [