def to_datasets(self) -> "datasets.Dataset":
        """Exports your records to a `datasets.Dataset`.

        Returns:
            A `datasets.Dataset` containing your records.
        """
        import datasets

        ds_dict = self._to_datasets_dict()
        # TODO: THIS FIELD IS ONLY AT CLIENT API LEVEL. NOT SENSE HERE FOR NOW
        if "search_keywords" in ds_dict:
            del ds_dict["search_keywords"]

        try:
            dataset = datasets.Dataset.from_dict(ds_dict)
        # try without metadata, since it is more prone to incompatible structures
        except Exception:
            del ds_dict["metadata"]
            dataset = datasets.Dataset.from_dict(ds_dict)
            warnings.warn(
                "The 'metadata' of the records were removed, since it was incompatible with the 'datasets' format."
            )

        return dataset
Exports your records to a `datasets.Dataset`.

        Returns:
            A `datasets.Dataset` containing your records.
        
argilla-v1/src/argilla_v1/client/datasets.py