diff --git a/ibis/expr/api.py b/ibis/expr/api.py index 0be1c52a6062..5c726715b447 100644 --- a/ibis/expr/api.py +++ b/ibis/expr/api.py @@ -2126,6 +2126,17 @@ def intersect(table: ir.Table, *rest: ir.Table, distinct: bool = True) -> ir.Tab │ 2 │ │ 2 │ └───────┘ + + More than two table expressions can be intersected at once. + >>> t3 = ibis.memtable({"a": [2, 3, 3]}) + >>> ibis.intersect(t1, t2, t3) + ┏━━━━━━━┓ + ┃ a ┃ + ┡━━━━━━━┩ + │ int64 │ + ├───────┤ + │ 2 │ + └───────┘ """ return table.intersect(*rest, distinct=distinct) if rest else table diff --git a/ibis/expr/types/relations.py b/ibis/expr/types/relations.py index 22ab9bbd3d21..ebbdea59c3c2 100644 --- a/ibis/expr/types/relations.py +++ b/ibis/expr/types/relations.py @@ -1757,6 +1757,17 @@ def intersect(self, table: Table, *rest: Table, distinct: bool = True) -> Table: │ 2 │ │ 2 │ └───────┘ + + More than two table expressions can be intersected at once. + >>> t3 = ibis.memtable({"a": [2, 3, 3]}) + >>> t1.intersect(t2, t3) + ┏━━━━━━━┓ + ┃ a ┃ + ┡━━━━━━━┩ + │ int64 │ + ├───────┤ + │ 2 │ + └───────┘ """ return self._assemble_set_op(ops.Intersection, table, *rest, distinct=distinct)