Skip to content

Commit

Permalink
Expose the 'data_hashes' filter on a dataset (#453)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-cord-tech authored Nov 2, 2023
1 parent 9624391 commit 93ce36d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions encord/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ def list_data_rows(
created_before: Optional[Union[str, datetime]] = None,
created_after: Optional[Union[str, datetime]] = None,
data_types: Optional[List[DataType]] = None,
data_hashes: Optional[List[str]] = None,
) -> List[DataRow]:
"""
Retrieve dataset rows (pointers to data, labels).
Expand All @@ -346,6 +347,7 @@ def list_data_rows(
created_before: optional datetime row filter
created_after: optional datetime row filter
data_types: optional data types row filter
data_hashes: optional list of individual data unit hashes to include
Returns:
List[DataRow]: A list of DataRows object that match the filter
Expand All @@ -372,6 +374,7 @@ def list_data_rows(
if data_types is not None
else None,
"dataset_access_settings": dataclasses.asdict(self._dataset_access_settings),
"data_hashes": data_hashes,
},
),
)
Expand Down
5 changes: 4 additions & 1 deletion encord/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def list_data_rows(
created_before: Optional[Union[str, datetime]] = None,
created_after: Optional[Union[str, datetime]] = None,
data_types: Optional[List[DataType]] = None,
data_hashes: Optional[List[str]] = None,
) -> List[DataRow]:
"""
Retrieve dataset rows (pointers to data, labels).
Expand All @@ -82,6 +83,8 @@ def list_data_rows(
created_before: optional datetime row filter
created_after: optional datetime row filter
data_types: optional data types row filter
data_hashes: optional list of individual data unit hashes to include
Returns:
List[DataRow]: A list of DataRows object that match the filter
Expand All @@ -92,7 +95,7 @@ def list_data_rows(
UnknownError: If an error occurs while retrieving the dataset.
"""

return self._client.list_data_rows(title_eq, title_like, created_before, created_after, data_types)
return self._client.list_data_rows(title_eq, title_like, created_before, created_after, data_types, data_hashes)

def refetch_data(self) -> None:
"""
Expand Down

0 comments on commit 93ce36d

Please sign in to comment.