Skip to content

Commit 90449d6

Browse files
author
Val Brodsky
committed
Add docstrings
1 parent 1b0e388 commit 90449d6

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

libs/labelbox/src/labelbox/schema/internal/data_row_create_upsert.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77

88
class DataRowItemBase(BaseModel, ABC):
9+
"""
10+
Base class for creating payloads for upsert operations.
11+
"""
912
id: dict
1013
payload: dict
1114

libs/labelbox/src/labelbox/schema/task.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,9 @@ def get_task(client, task_id):
230230

231231

232232
class DataUpsertTask(Task):
233+
"""
234+
Task class for data row upsert operations
235+
"""
233236
__max_donwload_size: Final = MAX_DATAROW_PER_API_OPERATION
234237

235238
def __init__(self, *args, **kwargs):
@@ -238,12 +241,18 @@ def __init__(self, *args, **kwargs):
238241

239242
@property
240243
def result(self) -> Optional[List[Dict[str, Any]]]: # type: ignore
244+
"""
245+
Fetches maximum 150K results. If you need to fetch more, use `result_all` property
246+
"""
241247
if self.status == "FAILED":
242248
raise ValueError(f"Job failed. Errors : {self.errors}")
243249
return self._results_as_list()
244250

245251
@property
246252
def errors(self) -> Optional[List[Dict[str, Any]]]: # type: ignore
253+
"""
254+
Fetches maximum 150K errors. If you need to fetch more, use `errors_all` property
255+
"""
247256
return self._errors_as_list()
248257

249258
@property
@@ -258,10 +267,19 @@ def failed_data_rows( # type: ignore
258267

259268
@property
260269
def result_all(self) -> PaginatedCollection:
270+
"""
271+
This method uses our standard PaginatedCollection and allow to fetch any number of results
272+
See here for more https://docs.labelbox.com/reference/sdk-fundamental-concepts-1#iterate-over-paginatedcollection
273+
"""
261274
return self._download_results_paginated()
262275

263276
@property
264277
def errors_all(self) -> PaginatedCollection:
278+
"""
279+
This method uses our standard PaginatedCollection and allow to fetch any number of errors
280+
See here for more https://docs.labelbox.com/reference/sdk-fundamental-concepts-1#iterate-over-paginatedcollection
281+
"""
282+
265283
return self._download_errors_paginated()
266284

267285
def _download_results_paginated(self) -> PaginatedCollection:

0 commit comments

Comments
 (0)