| 574 | |
| 575 | |
| 576 | class Unique(ApplyConcatApply): |
| 577 | _parameters = ["frame", "split_every", "split_out", "shuffle_method"] |
| 578 | _defaults = {"split_every": None, "split_out": True, "shuffle_method": "tasks"} |
| 579 | chunk = staticmethod(methods.unique) |
| 580 | aggregate_func = staticmethod(methods.unique) |
| 581 | |
| 582 | @functools.cached_property |
| 583 | def _meta(self): |
| 584 | return self.chunk( |
| 585 | meta_nonempty(self.frame._meta), series_name=self.frame._meta.name |
| 586 | ) |
| 587 | |
| 588 | @property |
| 589 | def split_by(self): |
| 590 | return self.name |
| 591 | |
| 592 | @property |
| 593 | def chunk_kwargs(self): |
| 594 | return {"series_name": self._meta.name} |
| 595 | |
| 596 | @property |
| 597 | def aggregate_kwargs(self): |
| 598 | return self.chunk_kwargs |
| 599 | |
| 600 | @classmethod |
| 601 | def combine(cls, inputs: list, **kwargs): # type: ignore |
| 602 | return _concat(inputs) |
| 603 | |
| 604 | @classmethod |
| 605 | def aggregate(cls, inputs: list, **kwargs): # type: ignore |
| 606 | df = _concat(inputs) |
| 607 | return cls.aggregate_func(df, **kwargs) |
| 608 | |
| 609 | |
| 610 | class DropDuplicates(Unique): |