Skip to content

Commit 60124d5

Browse files
author
Val Brodsky
committed
Fix for backward-compatibility
1 parent 770738f commit 60124d5

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

libs/labelbox/src/labelbox/client.py

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ def create_model_evaluation_project(
925925
self,
926926
dataset_id: Optional[str] = None,
927927
dataset_name: Optional[str] = None,
928-
data_row_count: int = 100,
928+
data_row_count: Optional[int] = None,
929929
**kwargs,
930930
) -> Project:
931931
"""
@@ -955,37 +955,34 @@ def create_model_evaluation_project(
955955
>>> This creates a new project with no data rows.
956956
957957
"""
958-
if data_row_count < 0:
959-
raise ValueError("data_row_count must be a positive integer.")
960-
961958
autogenerate_data_rows = False
962-
if dataset_id or dataset_name or data_row_count:
963-
warnings.warn(
964-
"Automatic generation of data rows of live model evaluation projects is deprecated. dataset_name_or_id, append_to_existing_dataset, data_row_count will be removed in a future version.",
965-
DeprecationWarning,
966-
)
959+
dataset_name_or_id = None
960+
append_to_existing_dataset = None
961+
962+
if dataset_id or dataset_name:
967963
autogenerate_data_rows = True
968964

969965
if dataset_id:
970966
append_to_existing_dataset = True
971967
dataset_name_or_id = dataset_id
972-
warnings.warn(
973-
"Automatic generation of data rows of live model evaluation projects is deprecated. dataset_name_or_id will be removed in a future version.",
974-
DeprecationWarning,
975-
)
976968
elif dataset_name:
977969
append_to_existing_dataset = False
978970
dataset_name_or_id = dataset_name
979-
warnings.warn(
980-
"Automatic generation of data rows of live model evaluation projects is deprecated. dataset_name_or_id will be removed in a future version.",
981-
DeprecationWarning,
982-
)
983971

984-
kwargs["media_type"] = MediaType.Conversational
985972
if autogenerate_data_rows:
986973
kwargs["dataset_name_or_id"] = dataset_name_or_id
987974
kwargs["append_to_existing_dataset"] = append_to_existing_dataset
975+
if data_row_count is None:
976+
data_row_count = 100
977+
if data_row_count < 0:
978+
raise ValueError("data_row_count must be a positive integer.")
988979
kwargs["data_row_count"] = data_row_count
980+
warnings.warn(
981+
"Automatic generation of data rows of live model evaluation projects is deprecated. dataset_name_or_id, append_to_existing_dataset, data_row_count will be removed in a future version.",
982+
DeprecationWarning,
983+
)
984+
985+
kwargs["media_type"] = MediaType.Conversational
989986
kwargs["editor_task_type"] = EditorTaskType.ModelChatEvaluation.value
990987

991988
return self._create_project(**kwargs)

0 commit comments

Comments
 (0)