@@ -292,7 +292,7 @@ def view(self) -> Table:
292
292
293
293
return ops .SelfReference (self ).to_expr ()
294
294
295
- def difference (self , right : Table ) -> Table :
295
+ def difference (self , right : Table , distinct : bool = True ) -> Table :
296
296
"""Compute the set difference of two table expressions.
297
297
298
298
The input tables must have identical schemas.
@@ -301,6 +301,8 @@ def difference(self, right: Table) -> Table:
301
301
----------
302
302
right
303
303
Table expression
304
+ distinct
305
+ Only diff distinct rows not occurring in the calling table
304
306
305
307
Returns
306
308
-------
@@ -309,7 +311,7 @@ def difference(self, right: Table) -> Table:
309
311
"""
310
312
from ibis .expr import operations as ops
311
313
312
- return ops .Difference (self , right ).to_expr ()
314
+ return ops .Difference (self , right , distinct = distinct ).to_expr ()
313
315
314
316
def aggregate (
315
317
self ,
@@ -455,8 +457,7 @@ def union(
455
457
right
456
458
Table expression
457
459
distinct
458
- Only union distinct rows not occurring in the calling table (this
459
- can be very expensive, be careful)
460
+ Only union distinct rows not occurring in the calling table
460
461
461
462
Returns
462
463
-------
@@ -467,7 +468,7 @@ def union(
467
468
468
469
return ops .Union (self , right , distinct = distinct ).to_expr ()
469
470
470
- def intersect (self , right : Table ) -> Table :
471
+ def intersect (self , right : Table , distinct : bool = True ) -> Table :
471
472
"""Compute the set intersection of two table expressions.
472
473
473
474
The input tables must have identical schemas.
@@ -476,6 +477,8 @@ def intersect(self, right: Table) -> Table:
476
477
----------
477
478
right
478
479
Table expression
480
+ distinct
481
+ Only intersect distinct rows not occurring in the calling table
479
482
480
483
Returns
481
484
-------
@@ -484,7 +487,7 @@ def intersect(self, right: Table) -> Table:
484
487
"""
485
488
from ibis .expr import operations as ops
486
489
487
- return ops .Intersection (self , right ).to_expr ()
490
+ return ops .Intersection (self , right , distinct = distinct ).to_expr ()
488
491
489
492
def to_array (self ) -> ir .Column :
490
493
"""View a single column table as an array.
0 commit comments