(left, right, sort)
| 104 | return f(df["1st"]) + f(df["3rd"]) * 1e2 + df["2nd"].fillna(0) * 10 |
| 105 | |
| 106 | def run_asserts(left, right, sort): |
| 107 | res = left.join(right, on=icols, how="left", sort=sort) |
| 108 | |
| 109 | assert len(left) < len(res) + 1 |
| 110 | assert not res["4th"].isna().any() |
| 111 | assert not res["5th"].isna().any() |
| 112 | |
| 113 | tm.assert_series_equal(res["4th"], -res["5th"], check_names=False) |
| 114 | result = bind_cols(res.iloc[:, :-2]) |
| 115 | tm.assert_series_equal(res["4th"], result, check_names=False) |
| 116 | assert result.name is None |
| 117 | |
| 118 | if sort: |
| 119 | tm.assert_frame_equal(res, res.sort_values(icols, kind="mergesort")) |
| 120 | |
| 121 | out = merge(left, right.reset_index(), on=icols, sort=sort, how="left") |
| 122 | |
| 123 | res.index = RangeIndex(len(res)) |
| 124 | tm.assert_frame_equal(out, res) |
| 125 | |
| 126 | lc = list(map(chr, np.arange(ord("a"), ord("z") + 1))) |
| 127 | left = DataFrame( |
nothing calls this directly
no test coverage detected