Skip to content

Commit

Permalink
Support commit_description parameter in push_to_hub (#6520)
Browse files Browse the repository at this point in the history
Support commit_description param in push_to_hub
  • Loading branch information
albertvillanova authored Dec 21, 2023
1 parent 8b04288 commit 0b2147a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/datasets/arrow_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -5228,6 +5228,7 @@ def push_to_hub(
set_default: Optional[bool] = None,
split: Optional[str] = None,
commit_message: Optional[str] = None,
commit_description: Optional[str] = None,
private: Optional[bool] = False,
token: Optional[str] = None,
revision: Optional[str] = None,
Expand Down Expand Up @@ -5258,6 +5259,11 @@ def push_to_hub(
The name of the split that will be given to that dataset. Defaults to `self.split`.
commit_message (`str`, *optional*):
Message to commit while pushing. Will default to `"Upload dataset"`.
commit_description (`str`, *optional*):
Description of the commit that will be created.
Additionally, description of the PR if a PR is created (`create_pr` is True).
<Added version="2.16.0"/>
private (`bool`, *optional*, defaults to `False`):
Whether the dataset repository should be set to private or not. Only affects repository creation:
a repository that already exists will not be affected by that parameter.
Expand Down Expand Up @@ -5525,6 +5531,7 @@ def push_to_hub(
repo_id,
operations=additions + deletions,
commit_message=commit_message,
commit_description=commit_description,
token=token,
repo_type="dataset",
revision=revision,
Expand All @@ -5543,6 +5550,7 @@ def push_to_hub(
repo_id,
operations=operations,
commit_message=commit_message + f" (part {i:05d}-of-{num_commits:05d})",
commit_description=commit_description,
token=token,
repo_type="dataset",
revision=revision,
Expand Down
8 changes: 8 additions & 0 deletions src/datasets/dataset_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -1559,6 +1559,7 @@ def push_to_hub(
config_name: str = "default",
set_default: Optional[bool] = None,
commit_message: Optional[str] = None,
commit_description: Optional[str] = None,
private: Optional[bool] = False,
token: Optional[str] = None,
revision: Optional[str] = None,
Expand Down Expand Up @@ -1589,6 +1590,11 @@ def push_to_hub(
named "default".
commit_message (`str`, *optional*):
Message to commit while pushing. Will default to `"Upload dataset"`.
commit_description (`str`, *optional*):
Description of the commit that will be created.
Additionally, description of the PR if a PR is created (`create_pr` is True).
<Added version="2.16.0"/>
private (`bool`, *optional*):
Whether the dataset repository should be set to private or not. Only affects repository creation:
a repository that already exists will not be affected by that parameter.
Expand Down Expand Up @@ -1802,6 +1808,7 @@ def push_to_hub(
repo_id,
operations=additions + deletions,
commit_message=commit_message,
commit_description=commit_description,
token=token,
repo_type="dataset",
revision=revision,
Expand All @@ -1820,6 +1827,7 @@ def push_to_hub(
repo_id,
operations=operations,
commit_message=commit_message + f" (part {i:05d}-of-{num_commits:05d})",
commit_description=commit_description,
token=token,
repo_type="dataset",
revision=revision,
Expand Down

0 comments on commit 0b2147a

Please sign in to comment.