Skip to content

Commit

Permalink
Delete transmit_tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
albertvillanova committed Jun 25, 2024
1 parent 8ae8644 commit 92b11a4
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/datasets/arrow_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,24 +582,6 @@ def wrapper(*args, **kwargs):
return wrapper


def transmit_tasks(func):
"""Wrapper for dataset transforms that recreate a new Dataset to transmit the task templates of the original dataset to the new dataset"""

@wraps(func)
def wrapper(*args, **kwargs):
if args:
self: "Dataset" = args[0]
args = args[1:]
else:
self: "Dataset" = kwargs.pop("self")
# apply actual function
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
return out

wrapper._decorator_name_ = "transmit_tasks"
return wrapper


def update_metadata_with_features(table: Table, features: Features):
"""To be used in dataset transforms that modify the features of the dataset, in order to update the features stored in the metadata of its schema."""
features = Features({col_name: features[col_name] for col_name in table.column_names})
Expand Down Expand Up @@ -2152,7 +2134,6 @@ def cast_column(self, column: str, feature: FeatureType, new_fingerprint: Option
features[column] = feature
return self.cast(features)

@transmit_tasks
@transmit_format
@fingerprint_transform(inplace=False)
def remove_columns(self, column_names: Union[str, List[str]], new_fingerprint: Optional[str] = None) -> "Dataset":
Expand Down Expand Up @@ -2208,7 +2189,6 @@ def remove_columns(self, column_names: Union[str, List[str]], new_fingerprint: O
dataset._fingerprint = new_fingerprint
return dataset

@transmit_tasks
@fingerprint_transform(inplace=False)
def rename_column(
self, original_column_name: str, new_column_name: str, new_fingerprint: Optional[str] = None
Expand Down Expand Up @@ -2275,7 +2255,6 @@ def rename(columns):
dataset._fingerprint = new_fingerprint
return dataset

@transmit_tasks
@fingerprint_transform(inplace=False)
def rename_columns(self, column_mapping: Dict[str, str], new_fingerprint: Optional[str] = None) -> "Dataset":
"""
Expand Down Expand Up @@ -2343,7 +2322,6 @@ def rename(columns):
dataset._fingerprint = new_fingerprint
return dataset

@transmit_tasks
@transmit_format
@fingerprint_transform(inplace=False)
def select_columns(self, column_names: Union[str, List[str]], new_fingerprint: Optional[str] = None) -> "Dataset":
Expand Down Expand Up @@ -2849,7 +2827,6 @@ def _get_cache_file_path(self, fingerprint):
cache_file_path = os.path.join(cache_directory, cache_file_name)
return cache_file_path

@transmit_tasks
@transmit_format
def map(
self,
Expand Down

0 comments on commit 92b11a4

Please sign in to comment.