Issue
Issue and Comment models for the Labelbox Python SDK.
Uses _CamelCaseMixin (Pydantic) instead of DbObject / Updateable
/ Deletable because the backend’s GraphQL mutations use typed input objects
incompatible with the ORM’s auto-generated mutations.
- class labelbox.schema.issue.Comment(*, id: str, content: str, createdBy: Any, createdAt: datetime, updatedAt: datetime)[source]
Bases:
_CamelCaseMixinA comment attached to an
Issue.- id
Unique identifier.
- Type:
str
- content
Comment body text.
- Type:
str
- created_at
Creation timestamp.
- Type:
datetime.datetime
- updated_at
Last-modification timestamp.
- Type:
datetime.datetime
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'arbitrary_types_allowed': True, 'populate_by_name': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'content': FieldInfo(annotation=str, required=True, alias='content', alias_priority=1), 'created_at': FieldInfo(annotation=datetime, required=True, alias='createdAt', alias_priority=1), 'created_by': FieldInfo(annotation=Any, required=True, alias='createdBy', alias_priority=1), 'id': FieldInfo(annotation=str, required=True, alias='id', alias_priority=1), 'updated_at': FieldInfo(annotation=datetime, required=True, alias='updatedAt', alias_priority=1)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- model_post_init(context: Any, /) None
This function is meant to behave like a BaseModel method to initialise private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self – The BaseModel instance.
context – The context.
- class labelbox.schema.issue.Issue(*, id: str, friendlyId: str, labelId: str | None = None, dataRowId: str | None = None, categoryId: str | None = None, content: str, position: Any | None = None, status: IssueStatus, createdBy: Any, resolvedBy: Any | None = None, createdAt: datetime, updatedAt: datetime, resolvedAt: datetime | None = None, contentUpdatedAt: datetime | None = None, latestReplyAt: datetime | None = None)[source]
Bases:
_CamelCaseMixinAn issue pinned to a data row within a project.
- id
Unique identifier.
- Type:
str
- friendly_id
Human-readable short identifier.
- Type:
str
- label_id
Associated label ID (may be
None).- Type:
str | None
- data_row_id
Associated data-row ID (may be
Nonefor legacy issues).- Type:
str | None
- category_id
Associated issue-category ID (may be
None).- Type:
str | None
- content
Issue body text.
- Type:
str
- position
Typed position model or
None.- Type:
Any | None
- status
IssueStatus(OPEN/RESOLVED).
- created_at
Creation timestamp.
- Type:
datetime.datetime
- updated_at
Last-modification timestamp.
- Type:
datetime.datetime
- resolved_at
Resolution timestamp, or
None.- Type:
datetime.datetime | None
- content_updated_at
Timestamp of last content edit, or
None.- Type:
datetime.datetime | None
- latest_reply_at
Timestamp of the most recent comment, or
None.- Type:
datetime.datetime | None
- category() IssueCategory | None[source]
Fetch the associated
IssueCategory.Requires
project_idto be set (automatically populated when the issue is obtained viaProjectmethods).- Returns:
The category, or
Noneifcategory_idis not set or the project context is unavailable.
- comments() List[Comment][source]
Fetch all comments for this issue.
- Returns:
List of
Commentinstances.
- create_comment(content: str) Comment[source]
Create a new comment on this issue.
- Parameters:
content – Comment body text.
- Returns:
The newly created
Comment.
- data_row() DataRow | None[source]
Fetch the associated
DataRow.- Returns:
The data row, or
Noneifdata_row_idis not set.
- label() Label | None[source]
Fetch the associated
Label.- Returns:
The label, or
Noneiflabel_idis not set.
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'arbitrary_types_allowed': True, 'populate_by_name': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'category_id': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='categoryId', alias_priority=1), 'content': FieldInfo(annotation=str, required=True, alias='content', alias_priority=1), 'content_updated_at': FieldInfo(annotation=Union[datetime, NoneType], required=False, default=None, alias='contentUpdatedAt', alias_priority=1), 'created_at': FieldInfo(annotation=datetime, required=True, alias='createdAt', alias_priority=1), 'created_by': FieldInfo(annotation=Any, required=True, alias='createdBy', alias_priority=1), 'data_row_id': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='dataRowId', alias_priority=1), 'friendly_id': FieldInfo(annotation=str, required=True, alias='friendlyId', alias_priority=1), 'id': FieldInfo(annotation=str, required=True, alias='id', alias_priority=1), 'label_id': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='labelId', alias_priority=1), 'latest_reply_at': FieldInfo(annotation=Union[datetime, NoneType], required=False, default=None, alias='latestReplyAt', alias_priority=1), 'position': FieldInfo(annotation=Union[Any, NoneType], required=False, default=None, alias='position', alias_priority=1), 'resolved_at': FieldInfo(annotation=Union[datetime, NoneType], required=False, default=None, alias='resolvedAt', alias_priority=1), 'resolved_by': FieldInfo(annotation=Union[Any, NoneType], required=False, default=None, alias='resolvedBy', alias_priority=1), 'status': FieldInfo(annotation=IssueStatus, required=True, alias='status', alias_priority=1), 'updated_at': FieldInfo(annotation=datetime, required=True, alias='updatedAt', alias_priority=1)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- model_post_init(context: Any, /) None
This function is meant to behave like a BaseModel method to initialise private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self – The BaseModel instance.
context – The context.
- resolve() Issue[source]
Resolve this issue.
- Returns:
Updated
Issuewithstatus == IssueStatus.RESOLVED.
- update(content: str | None = None, category_id: str | None = None, position: ImageIssuePosition | PdfIssuePosition | TextIssuePosition | VideoIssuePosition | None = None, label_id: str | None = None) Issue[source]
Update this issue.
Only the provided fields are modified; pass
Noneto leave a field unchanged.- Parameters:
content – New body text.
category_id – New category ID.
position – New position model.
label_id – New label ID.
- Returns:
Updated
Issueinstance.