Repository: pandas-dev/pandas-stubs (language: python)

Issue:
[mypy] Dataframe.Join with "cross" option for "how" argument throws error even though it's valid
**Describe the bug**
Using a "cross" join makes mypy throw a warning. 

**To Reproduce**
Create a file example.py with following contents:

```
import pandas as pd

df1 = pd.DataFrame({"A":[1,2], "B": ["test", "test"]})
df2 = pd.DataFrame({"C":[2, 3], "D": ["test", "test"]})
df3 = df1.join(df2,how="cross")
print(df3)
```

Run mypy on it: "mypy example.py "

Output:
example.py:5: error: Argument "how" to "join" of "DataFrame" has incompatible type "Literal['cross']"; expected "Literal['left', 'right', 'outer', 'inner']"  [arg-type]
Found 1 error in 1 file (checked 1 source file)

Expected output:
output with 0 errors

**Please complete the following information:**
 - OS: MacOs
 - OS Version: Sonoma 14.6
 - python version: 3.11.10
 - version of type checker: mypy 1.11.2
 - version of installed `pandas-stubs`: 2.2.2.240603


**Additional context**
Add any other context about the problem here.



Discussion / hints:

Fix patch:
diff --git a/pandas-stubs/core/frame.pyi b/pandas-stubs/core/frame.pyi
index 295aad8b..99d3e398 100644
--- a/pandas-stubs/core/frame.pyi
+++ b/pandas-stubs/core/frame.pyi
@@ -1421,7 +1421,7 @@ class DataFrame(NDFrame, OpsMixin):
         self,
         other: DataFrame | Series | list[DataFrame | Series],
         on: _str | list[_str] | None = ...,
-        how: JoinHow = ...,
+        how: MergeHow = ...,
         lsuffix: _str = ...,
         rsuffix: _str = ...,
         sort: _bool = ...,


Test patch:
diff --git a/tests/test_frame.py b/tests/test_frame.py
index f67294d5..2983040b 100644
--- a/tests/test_frame.py
+++ b/tests/test_frame.py
@@ -2345,6 +2345,16 @@ def test_join() -> None:
     check(assert_type(left.join(right, validate="1:m"), pd.DataFrame), pd.DataFrame)
 
 
+def test_types_join() -> None:
+    df1 = pd.DataFrame({"A": [1, 2], "B": ["test", "test"]})
+    df2 = pd.DataFrame({"C": [2, 3], "D": ["test", "test"]})
+    check(assert_type(df1.join(df2, how="cross"), pd.DataFrame), pd.DataFrame)
+    check(assert_type(df1.join(df2, how="inner"), pd.DataFrame), pd.DataFrame)
+    check(assert_type(df1.join(df2, how="outer"), pd.DataFrame), pd.DataFrame)
+    check(assert_type(df1.join(df2, how="left"), pd.DataFrame), pd.DataFrame)
+    check(assert_type(df1.join(df2, how="right"), pd.DataFrame), pd.DataFrame)
+
+
 def test_types_ffill() -> None:
     # GH 44
     df = pd.DataFrame([[1, 2, 3]])