Skip to content

Commit 600241b

Browse files
author
mvenkatakrishnan
committed
chore: Adding support for exclude_tombstoned list dataset
1 parent 0e35285 commit 600241b

1 file changed

Lines changed: 17 additions & 10 deletions

File tree

  • dataset-catalog-client/catalog_client/client

dataset-catalog-client/catalog_client/client/datasets.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,21 @@ def _build_list_params(
2121
version: str | None,
2222
modality: DatasetModality | None,
2323
project: str | None,
24-
is_latest: bool | None,
24+
is_latest: bool,
2525
include_lineage: bool,
2626
include_collections: bool,
27+
exclude_tombstoned: bool,
2728
offset: int,
2829
limit: int,
2930
) -> dict:
30-
params: dict = {"offset": offset, "limit": limit}
31+
params: dict = {
32+
"offset": offset,
33+
"limit": limit,
34+
"include_lineage": include_lineage,
35+
"include_collections": include_collections,
36+
"exclude_tombstoned": exclude_tombstoned,
37+
"is_latest": is_latest,
38+
}
3139
if canonical_id is not None:
3240
params["canonical_id"] = canonical_id
3341
if version is not None:
@@ -36,12 +44,6 @@ def _build_list_params(
3644
params["modality"] = modality.value
3745
if project is not None:
3846
params["project"] = project
39-
if is_latest is not None:
40-
params["is_latest"] = is_latest
41-
if include_lineage:
42-
params["include_lineage"] = True
43-
if include_collections:
44-
params["include_collections"] = True
4547
return params
4648

4749

@@ -53,9 +55,10 @@ def list(
5355
version: str | None = None,
5456
modality: DatasetModality | None = None,
5557
project: str | None = None,
56-
is_latest: bool | None = None,
58+
is_latest: bool = True,
5759
include_lineage: bool = False,
5860
include_collections: bool = False,
61+
exclude_tombstoned: bool = True,
5962
offset: int = 0,
6063
limit: int = 100,
6164
) -> PaginatedResponse[DatasetWithRelationsResponse]:
@@ -67,6 +70,7 @@ def list(
6770
is_latest,
6871
include_lineage,
6972
include_collections,
73+
exclude_tombstoned,
7074
offset,
7175
limit,
7276
)
@@ -81,6 +85,7 @@ def _resolve(self, ref: DatasetRef) -> str:
8185
project=ref.project,
8286
version=ref.version,
8387
limit=10,
88+
exclude_tombstoned=False,
8489
)
8590
result = response.results
8691
if len(result) == 0:
@@ -130,9 +135,10 @@ async def list(
130135
version: str | None = None,
131136
modality: DatasetModality | None = None,
132137
project: str | None = None,
133-
is_latest: bool | None = None,
138+
is_latest: bool = True,
134139
include_lineage: bool = False,
135140
include_collections: bool = False,
141+
exclude_tombstoned: bool = True,
136142
offset: int = 0,
137143
limit: int = 100,
138144
) -> PaginatedResponse[DatasetWithRelationsResponse]:
@@ -144,6 +150,7 @@ async def list(
144150
is_latest,
145151
include_lineage,
146152
include_collections,
153+
exclude_tombstoned,
147154
offset,
148155
limit,
149156
)

0 commit comments

Comments
 (0)