Skip to content

Commit

Permalink
fix(api): thread suffixes parameter to individual join methods
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud authored and kszucs committed Mar 7, 2022
1 parent fe59209 commit 31a9aff
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ibis/expr/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4889,7 +4889,7 @@ def f(
TableExpr
Joined `left` and `right`
""" # noqa: E501
return self.join(other, predicates, how=how)
return self.join(other, predicates, how=how, suffixes=suffixes)

f.__name__ = name
return f
Expand Down
10 changes: 10 additions & 0 deletions ibis/tests/expr/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -1431,3 +1431,13 @@ def test_filter_applied_to_join():
predicates=[countries["iso_alpha3"] == gdp["country_code"]],
).filter(gdp["year"] == 2017)
assert expr.columns == ["iso_alpha3", "country_code", "year"]


@pytest.mark.parametrize("how", ["inner", "left", "outer", "right"])
def test_join_suffixes(how):
left = ibis.table([("id", "int64"), ("first_name", "string")])
right = ibis.table([("id", "int64"), ("last_name", "string")])

method = getattr(left, f"{how}_join")
expr = method(right, suffixes=("_left", "_right"))
assert expr.columns == ["id_left", "first_name", "id_right", "last_name"]

0 comments on commit 31a9aff

Please sign in to comment.