Skip to content

Commit d610102

Browse files
committed
Fix arrow string test
1 parent b0c435e commit d610102

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

pandas/core/reshape/merge.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,7 @@ def __init__(
10321032
if validate is not None:
10331033
self._validate_validate_kwd(validate)
10341034

1035+
@final
10351036
def _validate_how(
10361037
self, how: JoinHow | Literal["left_anti", "right_anti", "asof"]
10371038
) -> tuple[JoinHow | Literal["asof"], bool]:

pandas/tests/reshape/merge/test_merge_antijoin.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def test_merge_antijoin_on_different_columns(self):
3636
"A": [3.0],
3737
"B": ["c"],
3838
"C": [np.nan],
39-
"D": np.array([np.nan], dtype=object),
39+
"D": np.array([np.nan], dtype=right.D.dtype),
4040
},
4141
index=[2],
4242
)
@@ -46,7 +46,7 @@ def test_merge_antijoin_on_different_columns(self):
4646
expected = DataFrame(
4747
{
4848
"A": [np.nan],
49-
"B": np.array([np.nan], dtype=object),
49+
"B": np.array([np.nan], dtype=left.B.dtype),
5050
"C": [2.0],
5151
"D": ["d"],
5252
},
@@ -64,7 +64,7 @@ def test_merge_antijoin_nonunique_keys(self):
6464
"A": [1.0],
6565
"B": ["a"],
6666
"C": [np.nan],
67-
"D": np.array([np.nan], dtype=object),
67+
"D": np.array([np.nan], dtype=right.D.dtype),
6868
},
6969
index=[0],
7070
)
@@ -74,7 +74,7 @@ def test_merge_antijoin_nonunique_keys(self):
7474
expected = DataFrame(
7575
{
7676
"A": [np.nan, np.nan],
77-
"B": np.array([np.nan, np.nan], dtype=object),
77+
"B": np.array([np.nan, np.nan], dtype=left.B.dtype),
7878
"C": [2.0, 4.0],
7979
"D": ["d", "d"],
8080
},
@@ -93,7 +93,7 @@ def test_merge_antijoin_nans(self):
9393
right = DataFrame({"A": [3.0, 2.0, np.nan], "D": ["d", "e", "f"]})
9494
result = merge(left, right, how="left_anti", on="A")
9595
expected = DataFrame(
96-
{"A": [1.0], "C": ["a"], "D": np.array([np.nan], dtype=object)}
96+
{"A": [1.0], "C": ["a"], "D": np.array([np.nan], dtype=right.D.dtype)}
9797
)
9898
tm.assert_frame_equal(result, expected)
9999

0 commit comments

Comments
 (0)