Skip to content

Commit e8e95b1

Browse files
Add exports v1 deprecation warning (#1256)
1 parent 7f2c6c6 commit e8e95b1

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

labelbox/schema/batch.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import requests
1010
import logging
1111
import time
12+
import warnings
1213

1314
if TYPE_CHECKING:
1415
from labelbox import Project
@@ -103,6 +104,9 @@ def export_data_rows(self,
103104
Raises:
104105
LabelboxError: if the export fails or is unable to download within the specified time.
105106
"""
107+
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. Find out more at this link: https://docs.labelbox.com/reference/label-export."
109+
)
106110
id_param = "batchId"
107111
metadata_param = "includeMetadataInput"
108112
query_str = """mutation GetBatchDataRowsExportUrlPyApi($%s: ID!, $%s: Boolean!)

labelbox/schema/dataset.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from collections.abc import Iterable
66
from string import Template
77
import time
8+
import warnings
89

910
from labelbox import parser
1011
from itertools import islice
@@ -565,6 +566,9 @@ def export_data_rows(self,
565566
Raises:
566567
LabelboxError: if the export fails or is unable to download within the specified time.
567568
"""
569+
warnings.warn(
570+
"You are currently utilizing exports v1 for this action, which will be deprecated after December 31st, 2023. We recommend transitioning to exports v2. Find out more at this link: https://docs.labelbox.com/reference/label-export."
571+
)
568572
id_param = "datasetId"
569573
metadata_param = "includeMetadataInput"
570574
query_str = """mutation GetDatasetDataRowsExportUrlPyApi($%s: ID!, $%s: Boolean!)

labelbox/schema/model_run.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import time
66
import logging
77
import requests
8+
import warnings
89
from labelbox import parser
910
from enum import Enum
1011

@@ -470,6 +471,9 @@ def export_labels(
470471
If the server didn't generate during the `timeout_seconds` period,
471472
None is returned.
472473
"""
474+
warnings.warn(
475+
"You are currently utilizing exports v1 for this action, which will be deprecated after December 31st, 2023. We recommend transitioning to exports v2. Find out more at this link: https://docs.labelbox.com/reference/label-export."
476+
)
473477
sleep_time = 2
474478
query_str = """mutation exportModelRunAnnotationsPyApi($modelRunId: ID!) {
475479
exportModelRunAnnotations(data: {modelRunId: $modelRunId}) {

labelbox/schema/project.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import json
22
import logging
33
import time
4+
import warnings
45
from collections import namedtuple
56
from datetime import datetime, timezone
67
from pathlib import Path
@@ -231,6 +232,9 @@ def export_queued_data_rows(
231232
Raises:
232233
LabelboxError: if the export fails or is unable to download within the specified time.
233234
"""
235+
warnings.warn(
236+
"You are currently utilizing exports v1 for this action, which will be deprecated after December 31st, 2023. We recommend transitioning to exports v2. Find out more at this link: https://docs.labelbox.com/reference/label-export."
237+
)
234238
id_param = "projectId"
235239
metadata_param = "includeMetadataInput"
236240
query_str = """mutation GetQueuedDataRowsExportUrlPyApi($%s: ID!, $%s: Boolean!)
@@ -334,6 +338,9 @@ def export_labels(self,
334338
URL of the data file with this Project's labels. If the server didn't
335339
generate during the `timeout_seconds` period, None is returned.
336340
"""
341+
warnings.warn(
342+
"You are currently utilizing exports v1 for this action, which will be deprecated after December 31st, 2023. We recommend transitioning to exports v2. Find out more at this link: https://docs.labelbox.com/reference/label-export."
343+
)
337344

338345
def _string_from_dict(dictionary: dict, value_with_quotes=False) -> str:
339346
"""Returns a concatenated string of the dictionary's keys and values

0 commit comments

Comments
 (0)