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
8 changes: 5 additions & 3 deletions src/datasets/arrow_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -5797,7 +5797,7 @@ def push_to_hub(
num_proc=num_proc,
)

def get_deletions_and_dataset_card() -> tuple[str, str, Optional[str]]:
def get_deletions_and_dataset_card() -> tuple[str, list[CommitOperationDelete], str, Optional[str]]:
parent_commit = api.repo_info(repo_id, repo_type="dataset", revision=revision).sha

# Check if the repo already has a README.md and/or a dataset_infos.json to update them with the new split info (size and pattern)
Expand Down Expand Up @@ -5977,7 +5977,9 @@ def get_deletions_and_dataset_card() -> tuple[str, str, Optional[str]]:
+ (f" (still {num_commits - i - 1} to go)" if num_commits - i - 1 else "")
+ "."
)
additions = []
last_commit_additions = []
else:
last_commit_additions = additions

for retry, sleep_time in enumerate(itertools.chain(range(10), itertools.repeat(30)), start=1):
# We need to retry if there was a commit in between in case it touched the dataset card data
Expand All @@ -5997,7 +5999,7 @@ def get_deletions_and_dataset_card() -> tuple[str, str, Optional[str]]:
try:
commit_info = api.create_commit(
repo_id,
operations=additions + dataset_card_additions + deletions,
operations=last_commit_additions + dataset_card_additions + deletions,
commit_message=commit_message,
commit_description=commit_description,
repo_type="dataset",
Expand Down
Loading
Loading