Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions libs/labelbox/src/labelbox/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,17 +425,8 @@ def get_datasets(self, where=None) -> PaginatedCollection:
"""
return self._get_all(Entity.Dataset, where)

def get_labeling_frontends(self, where=None) -> List[LabelingFrontend]:
"""Fetches all the labeling frontends.

>>> frontend = client.get_labeling_frontends(where=LabelingFrontend.name == "Editor")

Args:
where (Comparison, LogicalOperation or None): The `where` clause
for filtering.
Returns:
An iterable of LabelingFrontends (typically a PaginatedCollection).
"""
def _get_labeling_frontends(self, where=None) -> List[LabelingFrontend]:
"""Private method to obtain labeling front ends"""
return self._get_all(Entity.LabelingFrontend, where)

def _create(self, db_object_type, data, extra_params={}):
Expand Down
14 changes: 1 addition & 13 deletions libs/labelbox/src/labelbox/schema/labeling_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,7 @@


class LabelingFrontend(DbObject):
"""Label editor.

Represents an HTML / JavaScript UI that is used to generate
labels. “Editor” is the default Labeling Frontend that comes in every
organization. You can create new labeling frontends for an organization.

Attributes:
name (str)
description (str)
iframe_url_path (str)

projects (Relationship): `ToMany` relationship to Project
"""
"""Private db object representing a projects label editor"""

name = Field.String("name")
description = Field.String("description")
Expand Down
2 changes: 1 addition & 1 deletion libs/labelbox/src/labelbox/schema/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ def _connect_default_labeling_front_end(self, ontology_as_dict: dict):
): # Chat evaluation projects are automatically set up via the same api that creates a project
warnings.warn("Connecting default labeling editor for the project.")
labeling_frontend = next(
self.client.get_labeling_frontends(
self.client._get_labeling_frontends(
where=Entity.LabelingFrontend.name == "Editor"
)
)
Expand Down
4 changes: 2 additions & 2 deletions libs/labelbox/tests/integration/test_labeling_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

def test_get_labeling_frontends(client):
filtered_frontends = list(
client.get_labeling_frontends(where=LabelingFrontend.name == "Editor")
client._get_labeling_frontends(where=LabelingFrontend.name == "Editor")
)
assert len(filtered_frontends)


def test_labeling_frontend_connecting_to_project(project):
client = project.client
default_labeling_frontend = next(
client.get_labeling_frontends(where=LabelingFrontend.name == "Editor")
client._get_labeling_frontends(where=LabelingFrontend.name == "Editor")
)

assert project.labeling_frontend() is None
Expand Down
Loading