Skip to content

Commit

Permalink
updated type hinting of get_projects and get_datasets to return Pagin…
Browse files Browse the repository at this point in the history
…atedCollection
  • Loading branch information
Gabefire committed Mar 8, 2024
1 parent 7df06ca commit 092105e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions labelbox/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ def _get_all(self, db_object_type, where, filter_deleted=True):
[utils.camel_case(db_object_type.type_name()) + "s"],
db_object_type)

def get_projects(self, where=None) -> List[Project]:
def get_projects(self, where=None) -> PaginatedCollection:
""" Fetches all the projects the user has access to.
>>> projects = client.get_projects(where=(Project.name == "<project_name>") & (Project.description == "<project_description>"))
Expand All @@ -527,11 +527,11 @@ def get_projects(self, where=None) -> List[Project]:
where (Comparison, LogicalOperation or None): The `where` clause
for filtering.
Returns:
An iterable of Projects (typically a PaginatedCollection).
PaginatedCollection of all projects the user has access to or projects with the criteria specified.
"""
return self._get_all(Entity.Project, where)

def get_datasets(self, where=None) -> List[Dataset]:
def get_datasets(self, where=None) -> PaginatedCollection:
""" Fetches one or more datasets.
>>> datasets = client.get_datasets(where=(Dataset.name == "<dataset_name>") & (Dataset.description == "<dataset_description>"))
Expand All @@ -540,7 +540,7 @@ def get_datasets(self, where=None) -> List[Dataset]:
where (Comparison, LogicalOperation or None): The `where` clause
for filtering.
Returns:
An iterable of Datasets (typically a PaginatedCollection).
PaginatedCollection of all projects the user has access to or projects with the criteria specified.
"""
return self._get_all(Entity.Dataset, where)

Expand Down

0 comments on commit 092105e

Please sign in to comment.