Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ibis/expr/types/relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ def bind(self, *args: Any, **kwargs: Any) -> tuple[Value, ...]:
dm = DerefMap.from_targets(self.op())

bound = self._fast_bind(*args, **kwargs)
return (
return tuple(
derefed.to_expr().name(name) if original is not derefed else original
for name, original, derefed in zip(
(expr.get_name() for expr in bound),
Expand Down Expand Up @@ -5166,7 +5166,7 @@ def relocate(
def window_by(self, time_col: str | ir.Value, /) -> WindowedTable:
from ibis.expr.types.temporal_windows import WindowedTable

time_col = next(self.bind(time_col))
(time_col,) = self.bind(time_col)

# validate time_col is a timestamp column
if not isinstance(time_col, TimestampColumn):
Expand Down
6 changes: 4 additions & 2 deletions ibis/tests/expr/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -2014,6 +2014,8 @@ def test_unbind_with_namespace():

def test_table_bind():
def eq(left, right):
assert isinstance(left, tuple)
assert isinstance(right, tuple)
return all(a.equals(b) for a, b in zip(left, right))

t = ibis.table({"a": "int", "b": "string"}, name="t")
Expand Down Expand Up @@ -2101,13 +2103,13 @@ def eq(left, right):
assert eq(exprs, expected)

# no args
assert tuple(t.bind()) == ()
assert t.bind() == ()

def utter_failure(_):
raise ValueError("¡moo!")

with pytest.raises(ValueError, match="¡moo!"):
tuple(t.bind(foo=utter_failure))
t.bind(foo=utter_failure)


# TODO: remove when dropna is fully deprecated
Expand Down