Skip to content

Commit 31a9aff

Browse files
cpcloudkszucs
authored andcommitted
fix(api): thread suffixes parameter to individual join methods
1 parent fe59209 commit 31a9aff

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

ibis/expr/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4889,7 +4889,7 @@ def f(
48894889
TableExpr
48904890
Joined `left` and `right`
48914891
""" # noqa: E501
4892-
return self.join(other, predicates, how=how)
4892+
return self.join(other, predicates, how=how, suffixes=suffixes)
48934893

48944894
f.__name__ = name
48954895
return f

ibis/tests/expr/test_table.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,3 +1431,13 @@ def test_filter_applied_to_join():
14311431
predicates=[countries["iso_alpha3"] == gdp["country_code"]],
14321432
).filter(gdp["year"] == 2017)
14331433
assert expr.columns == ["iso_alpha3", "country_code", "year"]
1434+
1435+
1436+
@pytest.mark.parametrize("how", ["inner", "left", "outer", "right"])
1437+
def test_join_suffixes(how):
1438+
left = ibis.table([("id", "int64"), ("first_name", "string")])
1439+
right = ibis.table([("id", "int64"), ("last_name", "string")])
1440+
1441+
method = getattr(left, f"{how}_join")
1442+
expr = method(right, suffixes=("_left", "_right"))
1443+
assert expr.columns == ["id_left", "first_name", "id_right", "last_name"]

0 commit comments

Comments
 (0)