Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/datasets/features/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ def to_numpy(self, zero_copy_only=True):

return numpy_arr

def to_pylist(self):
def to_pylist(self, maps_as_pydicts: Optional[Literal["lossy", "strict"]] = None):
zero_copy_only = _is_zero_copy_only(self.storage.type, unnest=True)
numpy_arr = self.to_numpy(zero_copy_only=zero_copy_only)
if self.type.shape[0] is None and numpy_arr.dtype == object:
Expand Down
7 changes: 5 additions & 2 deletions tests/test_hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_convert_to_parquet(temporary_repo, hf_api, hf_token, ci_hub_config, ci_
- name: train
num_bytes: 55
num_examples: 5
download_size: 717
download_size: 725
dataset_size: 55
{METADATA_CONFIGS_FIELD}:
- config_name: first
Expand All @@ -105,7 +105,7 @@ def test_convert_to_parquet(temporary_repo, hf_api, hf_token, ci_hub_config, ci_
- name: train
num_bytes: 60
num_examples: 5
download_size: 723
download_size: 731
dataset_size: 60
{METADATA_CONFIGS_FIELD}:
- config_name: second
Expand All @@ -115,6 +115,9 @@ def test_convert_to_parquet(temporary_repo, hf_api, hf_token, ci_hub_config, ci_
---
"""),
]
if PYARROW_VERSION < version.parse("20.0.0"):
expected_readmes[0] = expected_readmes[0].replace("download_size: 725", "download_size: 717")
expected_readmes[1] = expected_readmes[1].replace("download_size: 731", "download_size: 723")
if PYARROW_VERSION < version.parse("18.1.0"):
expected_readmes[0] = expected_readmes[0].replace("download_size: 717", "download_size: 726")
expected_readmes[1] = expected_readmes[1].replace("download_size: 723", "download_size: 732")
Expand Down
Loading