diff --git a/ibis/backends/tests/test_join.py b/ibis/backends/tests/test_join.py index 436e2409766d..907d0b1d0f55 100644 --- a/ibis/backends/tests/test_join.py +++ b/ibis/backends/tests/test_join.py @@ -398,3 +398,20 @@ def test_positional_join(backend, con): result = con.execute(j) expected = pd.DataFrame({"x": [1, 2, 3], "x_right": [3, 2, 1]}) backend.assert_frame_equal(result, expected) + + +@pytest.mark.parametrize( + "preds", + [ + pytest.param(ibis._.x.upper(), id="single"), + pytest.param([ibis._.x.upper()], id="single-list"), + pytest.param([ibis._.x.upper(), ibis._.x.lower()], id="multiple"), + ], +) +def test_join_deferred(backend: BackendTest, con, preds): + t1 = ibis.memtable({"x": ["a", "b", "c"]}) + t2 = ibis.memtable({"x": ["A", "B", "Z"]}) + j = t1.inner_join(t2, predicates=preds) + result = con.execute(j) + expected = pd.DataFrame({"x": ["a", "b"], "x_right": ["A", "B"]}) + backend.assert_frame_equal(result, expected) diff --git a/ibis/expr/types/joins.py b/ibis/expr/types/joins.py index c0b9a7a8b817..e30877a4643d 100644 --- a/ibis/expr/types/joins.py +++ b/ibis/expr/types/joins.py @@ -7,7 +7,6 @@ import ibis.expr.operations as ops from ibis import util -from ibis.common.deferred import Deferred from ibis.common.egraph import DisjointSet from ibis.common.exceptions import ( ExpressionError, @@ -168,7 +167,7 @@ def prepare_predicates( left, right = chain.to_expr(), right.to_expr() for pred in util.promote_list(predicates): - if isinstance(pred, (Value, Deferred, bool)): + if isinstance(pred, (Value, bool)): for bound in bind(left, pred): yield deref_both.dereference(bound.op()) else: