Skip to content

Commit 3314ffe

Browse files
authored
Release 3.61.0 (#1375)
2 parents e8c927a + 6700fd4 commit 3314ffe

File tree

14 files changed

+225
-89
lines changed

14 files changed

+225
-89
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
# Changelog
2+
# Version 3.61.0 (2024-01-22)
3+
# Added
4+
* `ModelSlice.get_data_row_identifiers`
5+
* Fetches all data row ids and global keys for the model slice
6+
* NOTE Foundry model slices are note supported yet
7+
## Updated
8+
* Updated exports v1 deprecation date to April 30th, 2024
9+
* Remove `streamable` param from export_v2 methods
10+
211
# Version 3.60.0 (2024-01-17)
312
## Added
413
* Get resource tags from a project

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
copyright = '2021, Labelbox'
2222
author = 'Labelbox'
2323

24-
release = '3.60.0'
24+
release = '3.61.0'
2525

2626
# -- General configuration ---------------------------------------------------
2727

docs/source/index.rst

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -203,19 +203,11 @@ ResourceTag
203203
:members:
204204
:show-inheritance:
205205

206-
Slice
207-
-----------------------------------------
208-
209-
.. automodule:: labelbox.schema.slice
210-
:members: Slice
211-
:exclude-members: CatalogSlice
212-
:show-inheritance:
213206

214-
CatalogSlice
215-
-----------------------------------------
216-
.. automodule:: labelbox.schema.slice
217-
:members: CatalogSlice
218-
:exclude-members: Slice
207+
Slice
208+
---------------------------
209+
.. automodule:: labelbox.schema.slices
210+
:members:
219211
:show-inheritance:
220212

221213
QualityMode

examples/basics/Export_V1_to_V2_migration_support.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
{
4141
"metadata": {},
4242
"source": [
43-
"**Export V1 will no longer be available in any version of the SDK starting on April 20, 2024**. We recommend users to plan accordingly. \n",
43+
"**Export V1 will no longer be available in any version of the SDK starting on April 2024**. We recommend users to plan accordingly. \n",
4444
"\n",
4545
"This notebook is designed to help users identify alternative V2 export methods that can serve as replacements for V1 methods."
4646
],
@@ -51,9 +51,9 @@
5151
"source": [
5252
"### Key changes included in export V2 methods (``export_v2()`` and ``export()``):\n",
5353
"1. Added flexibility to only export the data that is needed. The new methods include parameters and filters to give you more granular control over your exports.\n",
54-
"2. Added functionality to stream your data export. \n",
54+
"2. Added functionality to stream your data export using ``export()`` (available on SDK >=3.56)\n",
5555
"\n",
56-
"For complete details on how to use exports V2 please see the [Export overview](https://docs.labelbox.com/reference/label-export#optional-parameters-and-filters) documentation."
56+
"For complete details on how to use export V2 methods please see the [Export V2 methods](https://docs.labelbox.com/reference/label-export#export-v2-methods) documentation."
5757
],
5858
"cell_type": "markdown"
5959
},
@@ -198,7 +198,7 @@
198198
" name='bounding_box',\n",
199199
" feature_schema_id='clrf5ck4a0b9b071paa9ncu15',\n",
200200
" extra={\n",
201-
" 'instanceURI': 'https://api.labelbox.com/masks/feature/clrf5csvi6ofm07lsf9pygwvi?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjbGh0OHNocXUweW53MDc0aWRuZDUyemd1Iiwib3JnYW5pemF0aW9uSWQiOiJjbDVibjhxdnExYXY5MDd4dGIzYnA4cTYwIiwiaWF0IjoxNzA1NDMxOTE3LCJleHAiOjE3MDgwMjM5MTd9.BSKLVSbKTNmp9tcYt-PncIBeZ2Hrw4kCOz3qyxvAoOY',\n",
201+
" 'instanceURI': 'https://api.labelbox.com/masks/feature/clrf5csvi6ofm07lsf9pygwvi?token=<token>'\n",
202202
" 'color': '#ff0000',\n",
203203
" 'feature_id': 'clrf5csvi6ofm07lsf9pygwvi',\n",
204204
" 'value': 'bounding_box',\n",

labelbox/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "labelbox"
22

3-
__version__ = "3.60.0"
3+
__version__ = "3.61.0"
44

55
from labelbox.client import Client
66
from labelbox.schema.project import Project

labelbox/client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1696,6 +1696,10 @@ def get_model_slice(self, slice_id) -> ModelSlice:
16961696
}
16971697
"""
16981698
res = self.execute(query_str, {"id": slice_id})
1699+
if res is None or res["getSavedQuery"] is None:
1700+
raise labelbox.exceptions.ResourceNotFoundError(
1701+
ModelSlice, slice_id)
1702+
16991703
return Entity.ModelSlice(self, res["getSavedQuery"])
17001704

17011705
def delete_feature_schema_from_ontology(

labelbox/schema/batch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def export_data_rows(self,
105105
LabelboxError: if the export fails or is unable to download within the specified time.
106106
"""
107107
warnings.warn(
108-
"You are currently utilizing exports v1 for this action, which will be deprecated after December 31st, 2023. We recommend transitioning to exports v2. To view export v2 details, visit our docs: https://docs.labelbox.com/reference/label-export",
108+
"You are currently utilizing exports v1 for this action, which will be deprecated after April 30th, 2024. We recommend transitioning to exports v2. To view export v2 details, visit our docs: https://docs.labelbox.com/reference/label-export",
109109
DeprecationWarning)
110110

111111
id_param = "batchId"

labelbox/schema/data_row.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,12 @@ def export(
188188
>>> task.wait_till_done()
189189
>>> task.result
190190
"""
191-
task = DataRow.export_v2(client,
192-
data_rows,
193-
global_keys,
194-
task_name,
195-
params,
196-
streamable=True)
191+
task = DataRow._export(client,
192+
data_rows,
193+
global_keys,
194+
task_name,
195+
params,
196+
streamable=True)
197197
return ExportTask(task)
198198

199199
@staticmethod
@@ -203,7 +203,6 @@ def export_v2(
203203
global_keys: Optional[List[str]] = None,
204204
task_name: Optional[str] = None,
205205
params: Optional[CatalogExportParams] = None,
206-
streamable: bool = False,
207206
) -> Task:
208207
"""
209208
Creates a data rows export task with the given list, params and returns the task.
@@ -228,7 +227,18 @@ def export_v2(
228227
>>> task.wait_till_done()
229228
>>> task.result
230229
"""
230+
return DataRow._export(client, data_rows, global_keys, task_name,
231+
params)
231232

233+
@staticmethod
234+
def _export(
235+
client: "Client",
236+
data_rows: Optional[List[Union[str, "DataRow"]]] = None,
237+
global_keys: Optional[List[str]] = None,
238+
task_name: Optional[str] = None,
239+
params: Optional[CatalogExportParams] = None,
240+
streamable: bool = False,
241+
) -> Task:
232242
_params = params or CatalogExportParams({
233243
"attachments": False,
234244
"metadata_fields": False,

labelbox/schema/dataset.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ def export_data_rows(self,
561561
LabelboxError: if the export fails or is unable to download within the specified time.
562562
"""
563563
warnings.warn(
564-
"You are currently utilizing exports v1 for this action, which will be deprecated after December 31st, 2023. We recommend transitioning to exports v2. To view export v2 details, visit our docs: https://docs.labelbox.com/reference/label-export",
564+
"You are currently utilizing exports v1 for this action, which will be deprecated after April 30th, 2024. We recommend transitioning to exports v2. To view export v2 details, visit our docs: https://docs.labelbox.com/reference/label-export",
565565
DeprecationWarning)
566566
id_param = "datasetId"
567567
metadata_param = "includeMetadataInput"
@@ -619,15 +619,14 @@ def export(
619619
>>> task.wait_till_done()
620620
>>> task.result
621621
"""
622-
task = self.export_v2(task_name, filters, params, streamable=True)
622+
task = self._export(task_name, filters, params, streamable=True)
623623
return ExportTask(task)
624624

625625
def export_v2(
626626
self,
627627
task_name: Optional[str] = None,
628628
filters: Optional[DatasetExportFilters] = None,
629629
params: Optional[CatalogExportParams] = None,
630-
streamable: bool = False,
631630
) -> Task:
632631
"""
633632
Creates a dataset export task with the given params and returns the task.
@@ -646,7 +645,15 @@ def export_v2(
646645
>>> task.wait_till_done()
647646
>>> task.result
648647
"""
648+
return self._export(task_name, filters, params)
649649

650+
def _export(
651+
self,
652+
task_name: Optional[str] = None,
653+
filters: Optional[DatasetExportFilters] = None,
654+
params: Optional[CatalogExportParams] = None,
655+
streamable: bool = False,
656+
) -> Task:
650657
_params = params or CatalogExportParams({
651658
"attachments": False,
652659
"metadata_fields": False,

labelbox/schema/model_run.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ def export_labels(
477477
None is returned.
478478
"""
479479
warnings.warn(
480-
"You are currently utilizing exports v1 for this action, which will be deprecated after December 31st, 2023. We recommend transitioning to exports v2. To view export v2 details, visit our docs: https://docs.labelbox.com/reference/label-export",
480+
"You are currently utilizing exports v1 for this action, which will be deprecated after April 30th, 2024. We recommend transitioning to exports v2. To view export v2 details, visit our docs: https://docs.labelbox.com/reference/label-export",
481481
DeprecationWarning)
482482
sleep_time = 2
483483
query_str = """mutation exportModelRunAnnotationsPyApi($modelRunId: ID!) {
@@ -518,21 +518,28 @@ def export(self,
518518
>>> export_task = export("my_export_task", params={"media_attributes": True})
519519
520520
"""
521-
task = self.export_v2(task_name, params, streamable=True)
521+
task = self._export(task_name, params, streamable=True)
522522
return ExportTask(task)
523523

524524
def export_v2(
525525
self,
526526
task_name: Optional[str] = None,
527527
params: Optional[ModelRunExportParams] = None,
528-
streamable: bool = False,
529528
) -> Task:
530529
"""
531530
Creates a model run export task with the given params and returns the task.
532531
533532
>>> export_task = export_v2("my_export_task", params={"media_attributes": True})
534533
535534
"""
535+
return self._export(task_name, params)
536+
537+
def _export(
538+
self,
539+
task_name: Optional[str] = None,
540+
params: Optional[ModelRunExportParams] = None,
541+
streamable: bool = False,
542+
) -> Task:
536543
mutation_name = "exportDataRowsInModelRun"
537544
create_task_query_str = (
538545
f"mutation {mutation_name}PyApi"
@@ -541,7 +548,7 @@ def export_v2(
541548

542549
_params = params or ModelRunExportParams()
543550

544-
queryParams = {
551+
query_params = {
545552
"input": {
546553
"taskName": task_name,
547554
"filters": {
@@ -563,7 +570,7 @@ def export_v2(
563570
}
564571
}
565572
res = self.client.execute(create_task_query_str,
566-
queryParams,
573+
query_params,
567574
error_log_key="errors")
568575
res = res[mutation_name]
569576
task_id = res["taskId"]

0 commit comments

Comments
 (0)