Skip to content

Commit 2b74007

Browse files
authored
[PLT-1581] Limiting labeling front end visibility and mentions of a custom editor (#1877)
1 parent 45527aa commit 2b74007

File tree

4 files changed

+6
-27
lines changed

4 files changed

+6
-27
lines changed

libs/labelbox/src/labelbox/client.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -420,17 +420,8 @@ def get_datasets(self, where=None) -> PaginatedCollection:
420420
"""
421421
return self._get_all(Entity.Dataset, where)
422422

423-
def get_labeling_frontends(self, where=None) -> List[LabelingFrontend]:
424-
"""Fetches all the labeling frontends.
425-
426-
>>> frontend = client.get_labeling_frontends(where=LabelingFrontend.name == "Editor")
427-
428-
Args:
429-
where (Comparison, LogicalOperation or None): The `where` clause
430-
for filtering.
431-
Returns:
432-
An iterable of LabelingFrontends (typically a PaginatedCollection).
433-
"""
423+
def _get_labeling_frontends(self, where=None) -> List[LabelingFrontend]:
424+
"""Private method to obtain labeling front ends"""
434425
return self._get_all(Entity.LabelingFrontend, where)
435426

436427
def _create(self, db_object_type, data, extra_params={}):

libs/labelbox/src/labelbox/schema/labeling_frontend.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,7 @@
33

44

55
class LabelingFrontend(DbObject):
6-
"""Label editor.
7-
8-
Represents an HTML / JavaScript UI that is used to generate
9-
labels. “Editor” is the default Labeling Frontend that comes in every
10-
organization. You can create new labeling frontends for an organization.
11-
12-
Attributes:
13-
name (str)
14-
description (str)
15-
iframe_url_path (str)
16-
17-
projects (Relationship): `ToMany` relationship to Project
18-
"""
6+
"""Private db object representing a projects label editor"""
197

208
name = Field.String("name")
219
description = Field.String("description")

libs/labelbox/src/labelbox/schema/project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ def _connect_default_labeling_front_end(self, ontology_as_dict: dict):
689689
): # Chat evaluation projects are automatically set up via the same api that creates a project
690690
warnings.warn("Connecting default labeling editor for the project.")
691691
labeling_frontend = next(
692-
self.client.get_labeling_frontends(
692+
self.client._get_labeling_frontends(
693693
where=Entity.LabelingFrontend.name == "Editor"
694694
)
695695
)

libs/labelbox/tests/integration/test_labeling_frontend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66

77
def test_get_labeling_frontends(client):
88
filtered_frontends = list(
9-
client.get_labeling_frontends(where=LabelingFrontend.name == "Editor")
9+
client._get_labeling_frontends(where=LabelingFrontend.name == "Editor")
1010
)
1111
assert len(filtered_frontends)
1212

1313

1414
def test_labeling_frontend_connecting_to_project(project):
1515
client = project.client
1616
default_labeling_frontend = next(
17-
client.get_labeling_frontends(where=LabelingFrontend.name == "Editor")
17+
client._get_labeling_frontends(where=LabelingFrontend.name == "Editor")
1818
)
1919

2020
assert project.labeling_frontend() is None

0 commit comments

Comments
 (0)