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
6 changes: 6 additions & 0 deletions nucleus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"DeduplicationJob",
"DeduplicationResult",
"DeduplicationStats",
"LocalDeduplicationResult",
"BoxPrediction",
"CameraParams",
"CategoryAnnotation",
Expand Down Expand Up @@ -43,6 +44,7 @@
"SegmentationPrediction",
"Slice",
"VideoScene",
"deduplicate_by_phash",
]

import datetime
Expand Down Expand Up @@ -147,6 +149,10 @@
NucleusAPIError,
)
from .job import CustomerJobTypes
from .local_deduplication import (
LocalDeduplicationResult,
deduplicate_by_phash,
)
from .model import Model
from .model_run import ModelRun
from .payload_constructor import (
Expand Down
4 changes: 3 additions & 1 deletion nucleus/data_transfer_object/dataset_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class DatasetInfo(DictCompatibleModel):
item_metadata_schema: Optional[Dict[str, Any]] = None
tags: List[str] = []

@validator("tags", pre=True, always=True) # pylint: disable=used-before-assignment
@validator(
"tags", pre=True, always=True
) # pylint: disable=used-before-assignment
def coerce_null_tags(cls, v): # pylint: disable=no-self-argument
return v if v is not None else []
8 changes: 6 additions & 2 deletions nucleus/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,9 @@ def add_tags(self, tags: List[str]) -> List[str]:
Updated list of all tags on the dataset.
"""
if isinstance(tags, str):
raise TypeError("tags must be a list of strings, not a single string")
raise TypeError(
"tags must be a list of strings, not a single string"
)
response = self._client.make_request(
{"tags": tags}, f"dataset/{self.id}/tags", requests.post
)
Expand All @@ -470,7 +472,9 @@ def remove_tags(self, tags: List[str]) -> List[str]:
Updated list of remaining tags on the dataset.
"""
if isinstance(tags, str):
raise TypeError("tags must be a list of strings, not a single string")
raise TypeError(
"tags must be a list of strings, not a single string"
)
response = self._client.make_request(
{"tags": tags}, f"dataset/{self.id}/tags", requests.delete
)
Expand Down
Loading