Check the HfApi documentation page for the reference of methods enabling interaction with Pull Requests and Discussions on the Hub.
( title: str status: typing.Literal['open', 'closed', 'merged', 'draft'] num: int repo_id: str repo_type: str author: str is_pull_request: bool created_at: datetime )
Parameters
str) —
The title of the Discussion / Pull Request
str) —
The status of the Discussion / Pull Request.
It must be one of:"open""closed""merged" (only for Pull Requests )"draft" (only for Pull Requests )int) —
The number of the Discussion / Pull Request.
str) —
The id ("{namespace}/{repo_name}") of the repo on which
the Discussion / Pull Request was open.
str) —
The type of the repo on which the Discussion / Pull Request was open.
Possible values are: "model", "dataset", "space".
str) —
The username of the Discussion / Pull Request author.
Can be "deleted" if the user has been deleted since.
bool) —
Whether or not this is a Pull Request.
datetime) —
The datetime of creation of the Discussion / Pull Request.
A Discussion or Pull Request on the Hub.
This dataclass is not intended to be instantiated directly.
( title: str status: typing.Literal['open', 'closed', 'merged', 'draft'] num: int repo_id: str repo_type: str author: str is_pull_request: bool created_at: datetime events: typing.List[ForwardRef('DiscussionEvent')] conflicting_files: typing.Optional[typing.List[str]] target_branch: typing.Optional[str] merge_commit_oid: typing.Optional[str] diff: typing.Optional[str] )
Parameters
str) —
The title of the Discussion / Pull Request
str) —
The status of the Discussion / Pull Request.
It can be one of:"open""closed""merged" (only for Pull Requests )"draft" (only for Pull Requests )int) —
The number of the Discussion / Pull Request.
str) —
The id ("{namespace}/{repo_name}") of the repo on which
the Discussion / Pull Request was open.
str) —
The type of the repo on which the Discussion / Pull Request was open.
Possible values are: "model", "dataset", "space".
str) —
The username of the Discussion / Pull Request author.
Can be "deleted" if the user has been deleted since.
bool) —
Whether or not this is a Pull Request.
datetime) —
The datetime of creation of the Discussion / Pull Request.
list of DiscussionEvent) —
The list of DiscussionEvents in this Discussion or Pull Request.
list of str, optional) —
A list of conflicting files if this is a Pull Request.
None if self.is_pull_request is False.
str, optional) —
The branch into which changes are to be merged if this is a
Pull Request . None if self.is_pull_request is False.
str, optional) —
If this is a merged Pull Request , this is set to the OID / SHA of
the merge commit, None otherwise.
str, optional) —
The git diff if this is a Pull Request , None otherwise.
Subclass of Discussion.
( id: str type: str created_at: datetime author: str _event: dict )
Parameters
str) —
The ID of the event. An hexadecimal string.
str) —
The type of the event.
datetime) —
A datetime
object holding the creation timestamp for the event.
str) —
The username of the Discussion / Pull Request author.
Can be "deleted" if the user has been deleted since.
An event in a Discussion or Pull Request.
Use concrete classes:
( id: str type: str created_at: datetime author: str _event: dict content: str edited: bool hidden: bool )
Parameters
str) —
The ID of the event. An hexadecimal string.
str) —
The type of the event.
datetime) —
A datetime
object holding the creation timestamp for the event.
str) —
The username of the Discussion / Pull Request author.
Can be "deleted" if the user has been deleted since.
str) —
The raw markdown content of the comment. Mentions, links and images are not rendered.
bool) —
Whether or not this comment has been edited.
bool) —
Whether or not this comment has been hidden.
A comment in a Discussion / Pull Request.
Subclass of DiscussionEvent.
( id: str type: str created_at: datetime author: str _event: dict new_status: str )
Parameters
str) —
The ID of the event. An hexadecimal string.
str) —
The type of the event.
datetime) —
A datetime
object holding the creation timestamp for the event.
str) —
The username of the Discussion / Pull Request author.
Can be "deleted" if the user has been deleted since.
str) —
The status of the Discussion / Pull Request after the change.
It can be one of:"open""closed""merged" (only for Pull Requests )A change of status in a Discussion / Pull Request.
Subclass of DiscussionEvent.
( id: str type: str created_at: datetime author: str _event: dict summary: str oid: str )
Parameters
str) —
The ID of the event. An hexadecimal string.
str) —
The type of the event.
datetime) —
A datetime
object holding the creation timestamp for the event.
str) —
The username of the Discussion / Pull Request author.
Can be "deleted" if the user has been deleted since.
str) —
The summary of the commit.
str) —
The OID / SHA of the commit, as a hexadecimal string.
A commit in a Pull Request.
Subclass of DiscussionEvent.
( id: str type: str created_at: datetime author: str _event: dict old_title: str new_title: str )
Parameters
str) —
The ID of the event. An hexadecimal string.
str) —
The type of the event.
datetime) —
A datetime
object holding the creation timestamp for the event.
str) —
The username of the Discussion / Pull Request author.
Can be "deleted" if the user has been deleted since.
str) —
The previous title for the Discussion / Pull Request.
str) —
The new title.
A rename event in a Discussion / Pull Request.
Subclass of DiscussionEvent.