Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud authored Jan 24, 2025
1 parent 96c3af2 commit ebc66de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions ibis/expr/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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")
┏━━━━━━━┓
Expand Down
6 changes: 3 additions & 3 deletions ibis/expr/types/relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------
Expand Down Expand Up @@ -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:
Expand All @@ -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")
┏━━━━━━━┓
Expand Down

0 comments on commit ebc66de

Please sign in to comment.