Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: On discussion with Sergei, actually Should be UUID #810

Merged
merged 1 commit into from
Dec 3, 2024
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
9 changes: 5 additions & 4 deletions encord/objects/ontology_labels_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from dataclasses import dataclass, field
from datetime import datetime
from typing import Any, Dict, Iterable, List, Optional, Sequence, Set, Type, Union
from uuid import UUID

from encord.client import EncordClientProject
from encord.client import LabelRow as OrmLabelRow
Expand Down Expand Up @@ -408,14 +409,14 @@ def audio_num_channels(self) -> Optional[int]:
return self._label_row_read_only_data.audio_num_channels

@property
def backing_item_uuid(self) -> Optional[str]:
def backing_item_uuid(self) -> Optional[UUID]:
"""
Returns the unique identifier (UUID) for the backing storage item associated with this label row.
The backing item UUID represents the storage reference for the data linked to the row.

While it is always included in server responses, it is marked as optional for backward compatibility with earlier versions.

Returns:
Optional[str]: The backing storage item id or None if not found.
Optional[UUID]: The backing storage item id or None if not found.
"""
# TODO: Mark required in 0.2 release
return self._label_row_read_only_data.backing_item_uuid
Expand Down Expand Up @@ -1589,7 +1590,7 @@ class LabelRowReadOnlyData:
last_edited_at: Optional[datetime]
data_hash: str
data_type: DataType
backing_item_uuid: Optional[str]
backing_item_uuid: Optional[UUID]
label_status: LabelStatus
annotation_task_status: Optional[AnnotationTaskStatus]
workflow_graph_node: Optional[WorkflowGraphNode]
Expand Down
5 changes: 3 additions & 2 deletions encord/orm/label_row.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from dataclasses import asdict, dataclass
from enum import Enum
from typing import Any, Dict, List, Optional
from uuid import UUID

from pydantic import Field

Expand Down Expand Up @@ -291,7 +292,7 @@ class LabelRowMetadata(Formatter):
"""Only available for certain read requests"""
is_valid: bool = True

backing_item_uuid: Optional[str] = None
backing_item_uuid: Optional[UUID] = None

@classmethod
def from_dict(cls, json_dict: Dict) -> LabelRowMetadata:
Expand Down Expand Up @@ -428,7 +429,7 @@ class LabelRowMetadataDTO(BaseDTO):
"""Only available for certain read requests"""
is_valid: bool = True

backing_item_uuid: Optional[str] = None
backing_item_uuid: Optional[UUID] = None


def label_row_metadata_dto_to_label_row_metadata(label_row_metadata_dto: LabelRowMetadataDTO) -> LabelRowMetadata:
Expand Down
Loading