From e67a745555daeab60a9d26fc1c461092757ebbfe Mon Sep 17 00:00:00 2001 From: Yamini Kancharana Date: Mon, 9 Oct 2023 16:30:41 -0700 Subject: [PATCH 1/6] add exports v1 deprecation warning --- labelbox/schema/batch.py | 3 +++ labelbox/schema/dataset.py | 3 +++ labelbox/schema/model_run.py | 3 +++ labelbox/schema/project.py | 10 ++++++++++ 4 files changed, 19 insertions(+) diff --git a/labelbox/schema/batch.py b/labelbox/schema/batch.py index f14ea55d2..8d7cb80b6 100644 --- a/labelbox/schema/batch.py +++ b/labelbox/schema/batch.py @@ -103,6 +103,9 @@ def export_data_rows(self, Raises: LabelboxError: if the export fails or is unable to download within the specified time. """ + print( + "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to the newer version. Learn more about exports v2 - https://docs.labelbox.com/reference/label-export" + ) id_param = "batchId" metadata_param = "includeMetadataInput" query_str = """mutation GetBatchDataRowsExportUrlPyApi($%s: ID!, $%s: Boolean!) diff --git a/labelbox/schema/dataset.py b/labelbox/schema/dataset.py index 01bc352b1..f64e19435 100644 --- a/labelbox/schema/dataset.py +++ b/labelbox/schema/dataset.py @@ -565,6 +565,9 @@ def export_data_rows(self, Raises: LabelboxError: if the export fails or is unable to download within the specified time. """ + print( + "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to the newer version. Learn more about exports v2 - https://docs.labelbox.com/reference/label-export" + ) id_param = "datasetId" metadata_param = "includeMetadataInput" query_str = """mutation GetDatasetDataRowsExportUrlPyApi($%s: ID!, $%s: Boolean!) diff --git a/labelbox/schema/model_run.py b/labelbox/schema/model_run.py index 530077110..b204159dc 100644 --- a/labelbox/schema/model_run.py +++ b/labelbox/schema/model_run.py @@ -470,6 +470,9 @@ def export_labels( If the server didn't generate during the `timeout_seconds` period, None is returned. """ + print( + "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to the newer version. Learn more about exports v2 - https://docs.labelbox.com/reference/label-export" + ) sleep_time = 2 query_str = """mutation exportModelRunAnnotationsPyApi($modelRunId: ID!) { exportModelRunAnnotations(data: {modelRunId: $modelRunId}) { diff --git a/labelbox/schema/project.py b/labelbox/schema/project.py index f3bc339c0..4ccdd179a 100644 --- a/labelbox/schema/project.py +++ b/labelbox/schema/project.py @@ -231,6 +231,9 @@ def export_queued_data_rows( Raises: LabelboxError: if the export fails or is unable to download within the specified time. """ + print( + "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to the newer version. Learn more about exports v2 - https://docs.labelbox.com/reference/label-export" + ) id_param = "projectId" metadata_param = "includeMetadataInput" query_str = """mutation GetQueuedDataRowsExportUrlPyApi($%s: ID!, $%s: Boolean!) @@ -353,6 +356,10 @@ def _string_from_dict(dictionary: dict, value_with_quotes=False) -> str: filter_param = "" filter_param_dict = {} + print( + "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to the newer version. Learn more about exports v2 - https://docs.labelbox.com/reference/label-export" + ) + if "start" in kwargs or "end" in kwargs: created_at_dict = { "start": kwargs.get("start", ""), @@ -519,6 +526,9 @@ def export_issues(self, status=None) -> str: Returns: URL of the data file with this Project's issues. """ + print( + "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to the newer version. Learn more about exports v2 - https://docs.labelbox.com/reference/label-export" + ) id_param = "projectId" status_param = "status" query_str = """query GetProjectIssuesExportPyApi($%s: ID!, $%s: IssueStatus) { From 16c5167a08f28c3ada695cfdc1c140b29585b258 Mon Sep 17 00:00:00 2001 From: Yamini Kancharana Date: Mon, 9 Oct 2023 16:33:36 -0700 Subject: [PATCH 2/6] update message --- labelbox/schema/batch.py | 2 +- labelbox/schema/dataset.py | 2 +- labelbox/schema/model_run.py | 2 +- labelbox/schema/project.py | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/labelbox/schema/batch.py b/labelbox/schema/batch.py index 8d7cb80b6..58ffa8224 100644 --- a/labelbox/schema/batch.py +++ b/labelbox/schema/batch.py @@ -104,7 +104,7 @@ def export_data_rows(self, LabelboxError: if the export fails or is unable to download within the specified time. """ print( - "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to the newer version. Learn more about exports v2 - https://docs.labelbox.com/reference/label-export" + "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to exports v2. Learn more about it here - https://docs.labelbox.com/reference/label-export" ) id_param = "batchId" metadata_param = "includeMetadataInput" diff --git a/labelbox/schema/dataset.py b/labelbox/schema/dataset.py index f64e19435..7a900f7be 100644 --- a/labelbox/schema/dataset.py +++ b/labelbox/schema/dataset.py @@ -566,7 +566,7 @@ def export_data_rows(self, LabelboxError: if the export fails or is unable to download within the specified time. """ print( - "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to the newer version. Learn more about exports v2 - https://docs.labelbox.com/reference/label-export" + "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to exports v2. Learn more about it here - https://docs.labelbox.com/reference/label-export" ) id_param = "datasetId" metadata_param = "includeMetadataInput" diff --git a/labelbox/schema/model_run.py b/labelbox/schema/model_run.py index b204159dc..df9a01768 100644 --- a/labelbox/schema/model_run.py +++ b/labelbox/schema/model_run.py @@ -471,7 +471,7 @@ def export_labels( None is returned. """ print( - "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to the newer version. Learn more about exports v2 - https://docs.labelbox.com/reference/label-export" + "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to exports v2. Learn more about it here - https://docs.labelbox.com/reference/label-export" ) sleep_time = 2 query_str = """mutation exportModelRunAnnotationsPyApi($modelRunId: ID!) { diff --git a/labelbox/schema/project.py b/labelbox/schema/project.py index 4ccdd179a..7906f6deb 100644 --- a/labelbox/schema/project.py +++ b/labelbox/schema/project.py @@ -232,7 +232,7 @@ def export_queued_data_rows( LabelboxError: if the export fails or is unable to download within the specified time. """ print( - "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to the newer version. Learn more about exports v2 - https://docs.labelbox.com/reference/label-export" + "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to exports v2. Learn more about it here - https://docs.labelbox.com/reference/label-export" ) id_param = "projectId" metadata_param = "includeMetadataInput" @@ -357,7 +357,7 @@ def _string_from_dict(dictionary: dict, value_with_quotes=False) -> str: filter_param_dict = {} print( - "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to the newer version. Learn more about exports v2 - https://docs.labelbox.com/reference/label-export" + "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to exports v2. Learn more about it here - https://docs.labelbox.com/reference/label-export" ) if "start" in kwargs or "end" in kwargs: @@ -527,7 +527,7 @@ def export_issues(self, status=None) -> str: URL of the data file with this Project's issues. """ print( - "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to the newer version. Learn more about exports v2 - https://docs.labelbox.com/reference/label-export" + "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to exports v2. Learn more about it here - https://docs.labelbox.com/reference/label-export" ) id_param = "projectId" status_param = "status" From c9120757ebcec3924ce61fa67a5690eeb4297ec0 Mon Sep 17 00:00:00 2001 From: Yamini Kancharana Date: Mon, 9 Oct 2023 16:34:38 -0700 Subject: [PATCH 3/6] update message --- labelbox/schema/project.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/labelbox/schema/project.py b/labelbox/schema/project.py index 7906f6deb..3a92b700d 100644 --- a/labelbox/schema/project.py +++ b/labelbox/schema/project.py @@ -337,6 +337,9 @@ def export_labels(self, URL of the data file with this Project's labels. If the server didn't generate during the `timeout_seconds` period, None is returned. """ + print( + "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to exports v2. Learn more about it here - https://docs.labelbox.com/reference/label-export" + ) def _string_from_dict(dictionary: dict, value_with_quotes=False) -> str: """Returns a concatenated string of the dictionary's keys and values @@ -356,10 +359,6 @@ def _string_from_dict(dictionary: dict, value_with_quotes=False) -> str: filter_param = "" filter_param_dict = {} - print( - "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to exports v2. Learn more about it here - https://docs.labelbox.com/reference/label-export" - ) - if "start" in kwargs or "end" in kwargs: created_at_dict = { "start": kwargs.get("start", ""), From 663905d37be8c02ab1c5950996bf0f3bac0b31ec Mon Sep 17 00:00:00 2001 From: Yamini Kancharana Date: Mon, 9 Oct 2023 16:43:49 -0700 Subject: [PATCH 4/6] make it a warning --- labelbox/schema/batch.py | 3 ++- labelbox/schema/dataset.py | 3 ++- labelbox/schema/model_run.py | 3 ++- labelbox/schema/project.py | 7 ++++--- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/labelbox/schema/batch.py b/labelbox/schema/batch.py index 58ffa8224..4c04e7920 100644 --- a/labelbox/schema/batch.py +++ b/labelbox/schema/batch.py @@ -9,6 +9,7 @@ import requests import logging import time +import warnings if TYPE_CHECKING: from labelbox import Project @@ -103,7 +104,7 @@ def export_data_rows(self, Raises: LabelboxError: if the export fails or is unable to download within the specified time. """ - print( + warnings.warn( "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to exports v2. Learn more about it here - https://docs.labelbox.com/reference/label-export" ) id_param = "batchId" diff --git a/labelbox/schema/dataset.py b/labelbox/schema/dataset.py index 7a900f7be..66ab19f8d 100644 --- a/labelbox/schema/dataset.py +++ b/labelbox/schema/dataset.py @@ -5,6 +5,7 @@ from collections.abc import Iterable from string import Template import time +import warnings from labelbox import parser from itertools import islice @@ -565,7 +566,7 @@ def export_data_rows(self, Raises: LabelboxError: if the export fails or is unable to download within the specified time. """ - print( + warnings.warn( "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to exports v2. Learn more about it here - https://docs.labelbox.com/reference/label-export" ) id_param = "datasetId" diff --git a/labelbox/schema/model_run.py b/labelbox/schema/model_run.py index df9a01768..a506ff4a0 100644 --- a/labelbox/schema/model_run.py +++ b/labelbox/schema/model_run.py @@ -5,6 +5,7 @@ import time import logging import requests +import warnings from labelbox import parser from enum import Enum @@ -470,7 +471,7 @@ def export_labels( If the server didn't generate during the `timeout_seconds` period, None is returned. """ - print( + warnings.warn( "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to exports v2. Learn more about it here - https://docs.labelbox.com/reference/label-export" ) sleep_time = 2 diff --git a/labelbox/schema/project.py b/labelbox/schema/project.py index 3a92b700d..66134fb3b 100644 --- a/labelbox/schema/project.py +++ b/labelbox/schema/project.py @@ -1,6 +1,7 @@ import json import logging import time +import warnings from collections import namedtuple from datetime import datetime, timezone from pathlib import Path @@ -231,7 +232,7 @@ def export_queued_data_rows( Raises: LabelboxError: if the export fails or is unable to download within the specified time. """ - print( + warnings.warn( "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to exports v2. Learn more about it here - https://docs.labelbox.com/reference/label-export" ) id_param = "projectId" @@ -337,7 +338,7 @@ def export_labels(self, URL of the data file with this Project's labels. If the server didn't generate during the `timeout_seconds` period, None is returned. """ - print( + warnings.warn( "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to exports v2. Learn more about it here - https://docs.labelbox.com/reference/label-export" ) @@ -525,7 +526,7 @@ def export_issues(self, status=None) -> str: Returns: URL of the data file with this Project's issues. """ - print( + warnings.warn( "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to exports v2. Learn more about it here - https://docs.labelbox.com/reference/label-export" ) id_param = "projectId" From 880e98ea4be7720f5e36511b869e187604642482 Mon Sep 17 00:00:00 2001 From: Yamini Kancharana Date: Tue, 10 Oct 2023 09:30:16 -0700 Subject: [PATCH 5/6] improved phrasing of the warning message --- labelbox/schema/batch.py | 2 +- labelbox/schema/dataset.py | 2 +- labelbox/schema/model_run.py | 2 +- labelbox/schema/project.py | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/labelbox/schema/batch.py b/labelbox/schema/batch.py index 4c04e7920..c7ba1105f 100644 --- a/labelbox/schema/batch.py +++ b/labelbox/schema/batch.py @@ -105,7 +105,7 @@ def export_data_rows(self, LabelboxError: if the export fails or is unable to download within the specified time. """ warnings.warn( - "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to exports v2. Learn more about it here - https://docs.labelbox.com/reference/label-export" + "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." ) id_param = "batchId" metadata_param = "includeMetadataInput" diff --git a/labelbox/schema/dataset.py b/labelbox/schema/dataset.py index 66ab19f8d..bfe7e02c3 100644 --- a/labelbox/schema/dataset.py +++ b/labelbox/schema/dataset.py @@ -567,7 +567,7 @@ def export_data_rows(self, LabelboxError: if the export fails or is unable to download within the specified time. """ warnings.warn( - "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to exports v2. Learn more about it here - https://docs.labelbox.com/reference/label-export" + "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." ) id_param = "datasetId" metadata_param = "includeMetadataInput" diff --git a/labelbox/schema/model_run.py b/labelbox/schema/model_run.py index a506ff4a0..7ced8c8f0 100644 --- a/labelbox/schema/model_run.py +++ b/labelbox/schema/model_run.py @@ -472,7 +472,7 @@ def export_labels( None is returned. """ warnings.warn( - "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to exports v2. Learn more about it here - https://docs.labelbox.com/reference/label-export" + "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." ) sleep_time = 2 query_str = """mutation exportModelRunAnnotationsPyApi($modelRunId: ID!) { diff --git a/labelbox/schema/project.py b/labelbox/schema/project.py index 66134fb3b..af03aff72 100644 --- a/labelbox/schema/project.py +++ b/labelbox/schema/project.py @@ -233,7 +233,7 @@ def export_queued_data_rows( LabelboxError: if the export fails or is unable to download within the specified time. """ warnings.warn( - "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to exports v2. Learn more about it here - https://docs.labelbox.com/reference/label-export" + "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." ) id_param = "projectId" metadata_param = "includeMetadataInput" @@ -339,7 +339,7 @@ def export_labels(self, generate during the `timeout_seconds` period, None is returned. """ warnings.warn( - "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to exports v2. Learn more about it here - https://docs.labelbox.com/reference/label-export" + "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." ) def _string_from_dict(dictionary: dict, value_with_quotes=False) -> str: @@ -527,7 +527,7 @@ def export_issues(self, status=None) -> str: URL of the data file with this Project's issues. """ warnings.warn( - "You are using the exports v1 to perform this operation which will be deprecated after Dec 31st, 2023. Please migrate to exports v2. Learn more about it here - https://docs.labelbox.com/reference/label-export" + "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." ) id_param = "projectId" status_param = "status" From 9af7a3fec3b6ded20f5b7d5ae73c4ad9a5866917 Mon Sep 17 00:00:00 2001 From: Yamini Kancharana Date: Tue, 10 Oct 2023 10:18:39 -0700 Subject: [PATCH 6/6] remove warning for export_issues endpoint --- labelbox/schema/project.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/labelbox/schema/project.py b/labelbox/schema/project.py index af03aff72..f76ff1024 100644 --- a/labelbox/schema/project.py +++ b/labelbox/schema/project.py @@ -526,9 +526,6 @@ def export_issues(self, status=None) -> str: Returns: URL of the data file with this Project's issues. """ - warnings.warn( - "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." - ) id_param = "projectId" status_param = "status" query_str = """query GetProjectIssuesExportPyApi($%s: ID!, $%s: IssueStatus) {