Skip to content

Commit

Permalink
fix(ir): accidentally remapping fields during bind() (#8988)
Browse files Browse the repository at this point in the history
Accidentally introduced in #8884
  • Loading branch information
kszucs authored Apr 17, 2024
1 parent b6c71d7 commit f4cee67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ibis/expr/types/relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def bind(table: Table, value: Any, int_as_column=False) -> Iterator[ir.Value]:
yield value
elif isinstance(value, Table):
for name in value.columns:
yield ops.Field(table, name).to_expr()
yield ops.Field(value, name).to_expr()
elif isinstance(value, Deferred):
yield value.resolve(table)
elif isinstance(value, Resolver):
Expand Down
9 changes: 2 additions & 7 deletions ibis/tests/expr/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@
from ibis import _
from ibis.common.annotations import ValidationError
from ibis.common.deferred import Deferred
from ibis.common.exceptions import (
ExpressionError,
IbisTypeError,
IntegrityError,
RelationError,
)
from ibis.common.exceptions import ExpressionError, IntegrityError, RelationError
from ibis.expr import api
from ibis.expr.rewrites import simplify
from ibis.expr.tests.test_newrels import join_tables
Expand Down Expand Up @@ -235,7 +230,7 @@ def test_projection_with_star_expr(table):

# cannot pass an invalid table expression
t2 = t.aggregate([t["a"].sum().name("sum(a)")], by=["g"])
with pytest.raises(IbisTypeError):
with pytest.raises(IntegrityError):
t[[t2]]
# TODO: there may be some ways this can be invalid

Expand Down

0 comments on commit f4cee67

Please sign in to comment.