Skip to content

Commit 6368b93

Browse files
vbrodskyreal-mjozwiakGabefiresfendell-labelboxmnoszczak
authored
Vb/merge 5.2 2 (#1867)
Co-authored-by: Michał Jóźwiak <mjozwiak@labelbox.com> Co-authored-by: Gabe <33893811+Gabefire@users.noreply.github.com> Co-authored-by: sfendell-labelbox <150080555+sfendell-labelbox@users.noreply.github.com> Co-authored-by: mnoszczak <99751601+mnoszczak@users.noreply.github.com>
1 parent 182aa67 commit 6368b93

26 files changed

+408
-176
lines changed

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
project = 'Python SDK reference'
1717
copyright = '2024, Labelbox'
1818
author = 'Labelbox'
19-
release = '5.1.0'
19+
release = '5.2.1'
2020

2121
# -- General configuration ---------------------------------------------------
2222

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Datarow payload templates
2+
===============================================================================================
3+
4+
.. automodule:: labelbox.schema.data_row_payload_templates
5+
:members:
6+
:show-inheritance:

libs/labelbox/CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Changelog
2-
# Version 5.1.0 (2024-09-27)
2+
# Version 5.2.1 (2024-10-09)
33
## Fixed
4+
* Exporter encoding
5+
6+
# Version 5.2.0 (2024-10-09)
7+
## Added
8+
* Support data row / batch for live mmc projects([#1856](https://github.com/Labelbox/labelbox-python/pull/1856))
9+
10+
# Version 5.1.0 (2024-09-27)
11+
## Added
412
* Support self-signed SSL certs([#1811](https://github.com/Labelbox/labelbox-python/pull/1811))
513
* Rectangle units now correctly support percent inputs([#1848](https://github.com/Labelbox/labelbox-python/pull/1848))
614

libs/labelbox/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "labelbox"
3-
version = "5.1.0"
3+
version = "5.2.1"
44
description = "Labelbox Python API"
55
authors = [{ name = "Labelbox", email = "engineering@labelbox.com" }]
66
dependencies = [
@@ -15,7 +15,7 @@ dependencies = [
1515
"lbox-clients==1.1.0",
1616
]
1717
readme = "README.md"
18-
requires-python = ">=3.9"
18+
requires-python = ">=3.9,<3.13"
1919
classifiers = [
2020
# How mature is this project?
2121
"Development Status :: 5 - Production/Stable",
Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,58 @@
11
name = "labelbox"
22

3-
__version__ = "5.1.0"
3+
__version__ = "5.2.1"
44

55
from labelbox.client import Client
6-
from labelbox.schema.project import Project
7-
from labelbox.schema.model import Model
8-
from labelbox.schema.model_config import ModelConfig
96
from labelbox.schema.annotation_import import (
7+
LabelImport,
108
MALPredictionImport,
119
MEAPredictionImport,
12-
LabelImport,
1310
MEAToMALPredictionImport,
1411
)
15-
from labelbox.schema.dataset import Dataset
16-
from labelbox.schema.data_row import DataRow
12+
from labelbox.schema.asset_attachment import AssetAttachment
13+
from labelbox.schema.batch import Batch
14+
from labelbox.schema.benchmark import Benchmark
1715
from labelbox.schema.catalog import Catalog
16+
from labelbox.schema.data_row import DataRow
17+
from labelbox.schema.data_row_metadata import (
18+
DataRowMetadata,
19+
DataRowMetadataField,
20+
DataRowMetadataOntology,
21+
DeleteDataRowMetadata,
22+
)
23+
from labelbox.schema.dataset import Dataset
1824
from labelbox.schema.enums import AnnotationImportState
19-
from labelbox.schema.label import Label
20-
from labelbox.schema.batch import Batch
21-
from labelbox.schema.review import Review
22-
from labelbox.schema.user import User
23-
from labelbox.schema.organization import Organization
24-
from labelbox.schema.task import Task
2525
from labelbox.schema.export_task import (
26-
StreamType,
26+
BufferedJsonConverterOutput,
2727
ExportTask,
2828
BufferedJsonConverterOutput,
2929
)
30+
from labelbox.schema.iam_integration import IAMIntegration
31+
from labelbox.schema.identifiable import GlobalKey, UniqueId
32+
from labelbox.schema.identifiables import DataRowIds, GlobalKeys, UniqueIds
33+
from labelbox.schema.invite import Invite, InviteLimit
34+
from labelbox.schema.label import Label
35+
from labelbox.schema.label_score import LabelScore
3036
from labelbox.schema.labeling_frontend import (
3137
LabelingFrontend,
3238
LabelingFrontendOptions,
3339
)
34-
from labelbox.schema.asset_attachment import AssetAttachment
35-
from labelbox.schema.webhook import Webhook
40+
from labelbox.schema.labeling_service import LabelingService
41+
from labelbox.schema.labeling_service_dashboard import LabelingServiceDashboard
42+
from labelbox.schema.labeling_service_status import LabelingServiceStatus
43+
from labelbox.schema.media_type import MediaType
44+
from labelbox.schema.model import Model
45+
from labelbox.schema.model_config import ModelConfig
46+
from labelbox.schema.model_run import DataSplit, ModelRun
3647
from labelbox.schema.ontology import (
48+
Classification,
49+
FeatureSchema,
3750
Ontology,
3851
OntologyBuilder,
39-
Classification,
4052
Option,
53+
PromptResponseClassification,
54+
ResponseOption,
4155
Tool,
42-
FeatureSchema,
4356
)
4457
from labelbox.schema.ontology import PromptResponseClassification
4558
from labelbox.schema.ontology import ResponseOption
@@ -64,10 +77,19 @@
6477
from labelbox.schema.identifiables import UniqueIds, GlobalKeys, DataRowIds
6578
from labelbox.schema.identifiable import UniqueId, GlobalKey
6679
from labelbox.schema.ontology_kind import OntologyKind
80+
from labelbox.schema.organization import Organization
81+
from labelbox.schema.project import Project
82+
from labelbox.schema.project_model_config import ProjectModelConfig
6783
from labelbox.schema.project_overview import (
6884
ProjectOverview,
6985
ProjectOverviewDetailed,
7086
)
71-
from labelbox.schema.labeling_service import LabelingService
72-
from labelbox.schema.labeling_service_dashboard import LabelingServiceDashboard
73-
from labelbox.schema.labeling_service_status import LabelingServiceStatus
87+
from labelbox.schema.project_resource_tag import ProjectResourceTag
88+
from labelbox.schema.resource_tag import ResourceTag
89+
from labelbox.schema.review import Review
90+
from labelbox.schema.role import ProjectRole, Role
91+
from labelbox.schema.slice import CatalogSlice, ModelSlice, Slice
92+
from labelbox.schema.task import Task
93+
from labelbox.schema.task_queue import TaskQueue
94+
from labelbox.schema.user import User
95+
from labelbox.schema.webhook import Webhook

libs/labelbox/src/labelbox/client.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import random
77
import time
88
import urllib.parse
9+
import warnings
910
from collections import defaultdict
1011
from datetime import datetime, timezone
1112
from types import MappingProxyType
@@ -584,7 +585,7 @@ def create_dataset(
584585
)
585586

586587
if not validation_result["validateDataset"]["valid"]:
587-
raise LabelboxError(
588+
raise labelbox.exceptions.LabelboxError(
588589
"IAMIntegration was not successfully added to the dataset."
589590
)
590591
except Exception as e:
@@ -649,7 +650,7 @@ def create_model_evaluation_project(
649650
is_consensus_enabled: Optional[bool] = None,
650651
dataset_id: Optional[str] = None,
651652
dataset_name: Optional[str] = None,
652-
data_row_count: int = 100,
653+
data_row_count: Optional[int] = None,
653654
) -> Project:
654655
"""
655656
Use this method exclusively to create a chat model evaluation project.
@@ -674,19 +675,20 @@ def create_model_evaluation_project(
674675
>>> client.create_model_evaluation_project(name=project_name, dataset_id="clr00u8j0j0j0", data_row_count=10)
675676
>>> This creates a new project, and adds 100 datarows to the dataset with id "clr00u8j0j0j0" and assigns a batch of the newly created 10 data rows to the project.
676677
678+
>>> client.create_model_evaluation_project(name=project_name)
679+
>>> This creates a new project with no data rows.
677680
678681
"""
679-
if not dataset_id and not dataset_name:
680-
raise ValueError(
681-
"dataset_name or data_set_id must be present and not be an empty string."
682-
)
682+
dataset_name_or_id = dataset_id or dataset_name
683+
append_to_existing_dataset = bool(dataset_id)
683684

684-
if dataset_id:
685-
append_to_existing_dataset = True
686-
dataset_name_or_id = dataset_id
687-
else:
688-
append_to_existing_dataset = False
689-
dataset_name_or_id = dataset_name
685+
if dataset_name_or_id:
686+
if data_row_count is None:
687+
data_row_count = 100
688+
warnings.warn(
689+
"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.",
690+
DeprecationWarning,
691+
)
690692

691693
media_type = MediaType.Conversational
692694
editor_task_type = EditorTaskType.ModelChatEvaluation

libs/labelbox/src/labelbox/data/annotation_types/collection.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
import logging
2-
from concurrent.futures import ThreadPoolExecutor, as_completed
3-
from typing import Callable, Generator, Iterable, Union, Optional
4-
from uuid import uuid4
52
import warnings
3+
from typing import Callable, Generator, Iterable, Union
64

7-
from tqdm import tqdm
8-
9-
from labelbox.schema import ontology
105
from labelbox.orm.model import Entity
11-
from ..ontology import get_classifications, get_tools
6+
from labelbox.schema import ontology
7+
128
from ..generator import PrefetchGenerator
139
from .label import Label
1410

libs/labelbox/src/labelbox/project_validation.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ def validate_fields(self):
6969
is_consensus_enabled=True,
7070
)
7171

72+
if self.data_row_count is not None and self.data_row_count < 0:
73+
raise ValueError("data_row_count must be a positive integer.")
74+
7275
return self
7376

7477
def _set_quality_mode_attributes(

libs/labelbox/src/labelbox/schema/catalog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def export_v2(
4848
"""
4949

5050
warnings.warn(
51-
"You are currently utilizing export_v2 for this action, which will be deprecated in a V7. Please refer to docs for export alternatives. https://docs.labelbox.com/reference/export-overview#export-methods",
51+
"You are currently utilizing export_v2 for this action, which will be removed in 7.0. Please refer to our docs for export alternatives. https://docs.labelbox.com/reference/export-overview#export-methods",
5252
DeprecationWarning,
5353
stacklevel=2,
5454
)

libs/labelbox/src/labelbox/schema/data_row.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def export_v2(
280280
"""
281281

282282
warnings.warn(
283-
"You are currently utilizing export_v2 for this action, which will be deprecated in a V7. Please refer to docs for export alternatives. https://docs.labelbox.com/reference/export-overview#export-methods",
283+
"You are currently utilizing export_v2 for this action, which will be removed in 7.0. Please refer to our docs for export alternatives. https://docs.labelbox.com/reference/export-overview#export-methods",
284284
DeprecationWarning,
285285
stacklevel=2,
286286
)

0 commit comments

Comments
 (0)