Repository: huggingface/dataset-viewer

Issue:
Update datasets to 2.10.0
After 2.10.0 `datasets` release, update dependencies on it.


Discussion:

Resolving patch:
diff --git a/services/worker/src/worker/job_runners/first_rows.py b/services/worker/src/worker/job_runners/first_rows.py
--- a/services/worker/src/worker/job_runners/first_rows.py
+++ b/services/worker/src/worker/job_runners/first_rows.py
@@ -378,7 +378,7 @@ def transform_rows(
 # > The terms "object" and "array" come from the conventions of JavaScript.
 # from https://stackoverflow.com/a/7214312/7351594 / https://www.rfc-editor.org/rfc/rfc7159.html
 def to_features_list(features: Features) -> List[FeatureItem]:
-    features_dict = features.to_dict()  # type: ignore
+    features_dict = features.to_dict()
     return [
         {
             "feature_idx": idx,
@@ -521,7 +521,7 @@ def compute_first_rows_response(
             )
             if not isinstance(iterable_dataset, IterableDataset):
                 raise TypeError("load_dataset should return an IterableDataset.")
-            iterable_dataset = iterable_dataset._resolve_features()  # type: ignore
+            iterable_dataset = iterable_dataset._resolve_features()
             if not isinstance(iterable_dataset, IterableDataset):
                 raise TypeError("load_dataset should return an IterableDataset.")
             features = iterable_dataset.features
diff --git a/services/worker/src/worker/job_runners/parquet_and_dataset_info.py b/services/worker/src/worker/job_runners/parquet_and_dataset_info.py
--- a/services/worker/src/worker/job_runners/parquet_and_dataset_info.py
+++ b/services/worker/src/worker/job_runners/parquet_and_dataset_info.py
@@ -504,7 +504,7 @@ def _request_size(url: str, hf_token: Optional[str] = None) -> Optional[int]:
     return int(size) if size is not None else size
 
 
-class _MockStreamingDownloadManager(StreamingDownloadManager):
+class _MockStreamingDownloadManager(StreamingDownloadManager):  # type: ignore
     def __init__(self, *args: Any, **kwargs: Any) -> None:
         super().__init__(*args, **kwargs)
         self.ext_data_files: List[str] = []
@@ -514,7 +514,7 @@ def download(self, url_or_urls: Any) -> Any:
             self._download,
             url_or_urls,
             map_tuple=True,
-            parallel_min_length=np.inf,  # type: ignore
+            parallel_min_length=np.inf,
             # ^ parallel_min_length has int type, but is currently used in datasets for a comparison only
             # and it works with np.inf. No conversion is involved
             # (would raise: OverflowError: cannot convert float infinity to integer)
@@ -544,7 +544,7 @@ def raise_if_too_big_from_external_data_files(
         base_path=builder.base_path, download_config=DownloadConfig(use_auth_token=hf_token)
     )
     try:
-        builder._split_generators(mock_dl_manager)  # type: ignore
+        builder._split_generators(mock_dl_manager)
     except (requests.exceptions.RequestException, NotImplementedError) as error:
         if isinstance(error, NotImplementedError):
             # we can ignore the errors from functions not implemented in streaming mode like `.extract()` on TAR files
@@ -790,7 +790,7 @@ def compute_parquet_and_dataset_info_response(
             hf_token=hf_token,
         )
         builder.download_and_prepare(file_format="parquet")  # the parquet files are stored in the cache dir
-        dataset_info[config] = asdict(builder.info)  # type: ignore
+        dataset_info[config] = asdict(builder.info)
         # ^ see
         # https://github.dev/huggingface/datasets/blob/e183a269067575db8765ee979bd8523d14a1adae/src/datasets/info.py#L244-L245
         # note that asdict() is not typed in the datasets library, hence type: ignore


Test patch:
diff --git a/services/worker/tests/fixtures/datasets.py b/services/worker/tests/fixtures/datasets.py
--- a/services/worker/tests/fixtures/datasets.py
+++ b/services/worker/tests/fixtures/datasets.py
@@ -32,7 +32,7 @@ def value(content: Any, dtype: Any) -> Dataset:
 
 def other(content: Any, feature_type: Optional[FeatureType] = None) -> Dataset:
     if feature_type:
-        features = Features({"col": feature_type})  # type: ignore
+        features = Features({"col": feature_type})
         return Dataset.from_dict({"col": [content]}, features=features)
     else:
         return Dataset.from_dict({"col": [content]})
diff --git a/services/worker/tests/fixtures/hub.py b/services/worker/tests/fixtures/hub.py
--- a/services/worker/tests/fixtures/hub.py
+++ b/services/worker/tests/fixtures/hub.py
@@ -330,7 +330,7 @@ def create_dataset_info_response_for_csv(dataset: str, config: str) -> Any:
         "download_checksums": {
             f"https://hub-ci.huggingface.co/datasets/{dataset}/resolve/__COMMIT__/dataset.csv": {
                 "num_bytes": 50,
-                "checksum": "441b6927a5442803821415bdcb0f418731b0d2a525a7f2e68ce0df0e95d444de",
+                "checksum": None,
             }
         },
         "download_size": 50,
@@ -349,13 +349,13 @@ def create_dataset_info_response_for_audio(dataset: str, config: str) -> Any:
         "splits": {"train": {"name": "train", "num_bytes": 59, "num_examples": 1, "dataset_name": "parquet"}},
         "download_checksums": {
             "SOME_KEY": {
-                "num_bytes": 1124,
-                "checksum": "3b630ef6ede66c5ced336df78fd99d98f835b459baadbe88a2cdf180709e9543",
+                "num_bytes": 1383,
+                "checksum": None,
             }
         },
-        "download_size": 1124,
+        "download_size": 1383,
         "dataset_size": 59,
-        "size_in_bytes": 1183,
+        "size_in_bytes": 1442,
     }