From ebc66de512fb11f777ed12eed4115270a2c4affe Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Fri, 24 Jan 2025 04:34:30 -0500 Subject: [PATCH] Apply suggestions from code review --- ibis/expr/api.py | 6 +++--- ibis/expr/types/relations.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ibis/expr/api.py b/ibis/expr/api.py index 8dabf05603d0..75fddb025557 100644 --- a/ibis/expr/api.py +++ b/ibis/expr/api.py @@ -2180,7 +2180,7 @@ def difference(table: ir.Table, *rest: ir.Table, distinct: bool = True) -> ir.Ta >>> t1 = ibis.memtable({"a": [7, 8, 8, 9, 9, 9]}) >>> t2 = ibis.memtable({"a": [8, 9]}) - With distinct=True, if a row ever appears in any of `*rest`, + With `distinct=True`, if a row ever appears in any of `*rest`, it will not appear in the result. So here, all appearances of 8 and 9 are removed: @@ -2193,7 +2193,7 @@ def difference(table: ir.Table, *rest: ir.Table, distinct: bool = True) -> ir.Ta │ 7 │ └───────┘ - With `distinct=False`, the algorithm is more of a multiset/bag difference. + With `distinct=False`, the algorithm is a [multiset](https://en.wikipedia.org/wiki/Multiset) difference. This means, that since 8 and 9 each appear once in `t2`, the result will be the input with a single instance of each removed: @@ -2210,7 +2210,7 @@ def difference(table: ir.Table, *rest: ir.Table, distinct: bool = True) -> ir.Ta └───────┘ With multiple tables in `*rest`, we apply the operation consecutively. - Here, we we remove two 8s and two 9s: + Here, we remove two eights and two nines: >>> t1.difference(t2, t2, distinct=False).order_by("a") ┏━━━━━━━┓ diff --git a/ibis/expr/types/relations.py b/ibis/expr/types/relations.py index e72bb5211cda..9699ec882fdf 100644 --- a/ibis/expr/types/relations.py +++ b/ibis/expr/types/relations.py @@ -1783,7 +1783,7 @@ def difference(self, table: Table, *rest: Table, distinct: bool = True) -> Table *rest Additional table expressions distinct - Use set difference (True) or multiset difference (False). See examples. + Use set difference (`True`) or multiset difference (`False`). See examples. See Also -------- @@ -1814,7 +1814,7 @@ def difference(self, table: Table, *rest: Table, distinct: bool = True) -> Table │ 7 │ └───────┘ - With `distinct=False`, the algorithm is more of a multiset/bag difference. + With `distinct=False`, the algorithm is a [multiset](https://en.wikipedia.org/wiki/Multiset) difference. This means, that since 8 and 9 each appear once in `t2`, the result will be the input with a single instance of each removed: @@ -1831,7 +1831,7 @@ def difference(self, table: Table, *rest: Table, distinct: bool = True) -> Table └───────┘ With multiple tables in `*rest`, we apply the operation consecutively. - Here, we we remove two 8s and two 9s: + Here, we remove two eights and two nines: >>> t1.difference(t2, t2, distinct=False).order_by("a") ┏━━━━━━━┓