Skip to content

Commit

Permalink
test(relocate): ensure that the behavior of tuple inputs is tested
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Jul 20, 2024
1 parent 02e2242 commit c237526
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ibis/tests/expr/test_relocate.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,14 @@ def test_no_arguments():
t = ibis.table(dict(x="int", y="int", z="int"))
with pytest.raises(exc.IbisInputError, match="At least one selector"):
t.relocate()


def test_tuple_input():
t = ibis.table(dict(x="int", y="int", z="int"))
assert t.relocate(("y", "z")).columns == list("yzx")

# not allowed, because this would be technically inconsistent with `select`
# though, the tuple is unambiguous here and could never be interpreted as a
# scalar array
with pytest.raises(KeyError):
t.relocate(("y", "z"), "x")

0 comments on commit c237526

Please sign in to comment.