def _record_dicts_from_datasets(
        hf_dataset: "HFDataset", mapper: "IngestedRecordMapper"
    ) -> List[Dict[str, Union[str, float, int, list]]]:
        """Creates a dictionaries from an HF dataset that can be passed to DatasetRecords.add or DatasetRecords.update.

        Parameters:
            hf_dataset (HFDataset): The dataset containing the records.

        Returns:
            Generator[Dict[str, Union[str, float, int, list]], None, None]: A generator of dictionaries to be passed to DatasetRecords.add or DatasetRecords.update.
        """

        hf_dataset = HFDatasetsIO.to_argilla(hf_dataset=hf_dataset, mapper=mapper)

        try:
            hf_dataset = hf_dataset.to_iterable_dataset()
        except AttributeError:
            pass

        record_dicts = [example for example in hf_dataset]
        return record_dicts
Creates a dictionaries from an HF dataset that can be passed to DatasetRecords.add or DatasetRecords.update.

        Parameters:
            hf_dataset (HFDataset): The dataset containing the records.

        Returns:
            Generator[Dict[str, Union[str, float, int, list]], None, None]: A generator of dictionaries to be passed to DatasetRecords.add or DatasetRecords.update.
        
argilla/src/argilla/records/_io/_datasets.py