def unique()

in eland/operations.py [0:0]


    def unique(self, query_compiler: "QueryCompiler") -> pd.Series:
        query_params, _ = self._resolve_tasks(query_compiler)
        body = Query(query_params.query)

        fields = query_compiler._mappings.all_source_fields()
        assert len(fields) == 1  # Unique is only for eland.Series
        field = fields[0]
        bucket_key = f"unique_{field.column}"

        body.composite_agg_bucket_terms(
            name=bucket_key,
            field=field.aggregatable_es_field_name,
        )

        # Composite aggregation
        body.composite_agg_start(size=DEFAULT_PAGINATION_SIZE, name="unique_buckets")

        unique_buckets: List[Any] = sum(
            self.bucket_generator(query_compiler, body, agg_name="unique_buckets"), []  # type: ignore
        )

        return np.array(
            [bucket["key"][bucket_key] for bucket in unique_buckets],
            dtype=field.pd_dtype,
        )