Skip to content

Commit 0d714b5

Browse files
committed
CR
1 parent 79e9c76 commit 0d714b5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

libs/labelbox/src/labelbox/client.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ def _create_project(self, **kwargs) -> Project:
863863
auto_audit_number_of_labels = kwargs.get("auto_audit_number_of_labels")
864864
if auto_audit_percentage is not None or auto_audit_number_of_labels is not None:
865865
raise ValueError(
866-
"quality_mode must be set instead of auto_audit_percentage or auto_audit_number_of_labels."
866+
"quality_modes must be set instead of auto_audit_percentage or auto_audit_number_of_labels."
867867
)
868868

869869
name = kwargs.get("name")
@@ -895,6 +895,11 @@ def _create_project(self, **kwargs) -> Project:
895895

896896
quality_modes = kwargs.get("quality_modes")
897897
quality_mode = kwargs.get("quality_mode")
898+
if quality_mode:
899+
logger.warning(
900+
"Passing quality_mode is deprecated and will soon no longer be supported. Use quality_modes instead."
901+
)
902+
898903
if quality_modes and quality_mode:
899904
raise ValueError(
900905
"Cannot use both quality_modes and quality_mode at the same time. Use one or the other.")
@@ -905,7 +910,7 @@ def _create_project(self, **kwargs) -> Project:
905910
data = kwargs
906911
data.pop("quality_modes", None)
907912
data.pop("quality_mode", None)
908-
if quality_modes is None or quality_modes == [QualityMode.Benchmark] or quality_mode is QualityMode.Benchmark:
913+
if quality_modes is None or len(quality_modes) == 0 or quality_modes == [QualityMode.Benchmark] or quality_mode is QualityMode.Benchmark:
909914
data[
910915
"auto_audit_number_of_labels"] = BENCHMARK_AUTO_AUDIT_NUMBER_OF_LABELS
911916
data["auto_audit_percentage"] = BENCHMARK_AUTO_AUDIT_PERCENTAGE

0 commit comments

Comments
 (0)