Skip to content

Commit 24523b6

Browse files
author
mvenkatakrishnan
committed
Adding check for tombstoned update
1 parent 600241b commit 24523b6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • dataset-catalog-client/catalog_client/client

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ def _create_or_update(
128128
canonical_id=dataset.canonical_id,
129129
version=dataset.version,
130130
project=dataset.project,
131+
exclude_tombstoned=False,
131132
limit=10, # reasonable limit for duplicates check
132133
)
133134
existing_datasets = results.results
@@ -146,13 +147,12 @@ def _create_or_update(
146147
f"Multiple datasets found ({len(existing_datasets)}) for {dataset_ref!r}"
147148
)
148149

150+
existing_dataset = existing_datasets[0]
149151
if update_if_exists:
150-
existing_dataset = existing_datasets[0]
151152
self.datasets.update(existing_dataset.id, dataset)
152153
return existing_dataset.id
153154

154-
# Default: return existing dataset ID without error
155-
return existing_datasets[0].id
155+
return existing_dataset.id
156156

157157

158158
class AsyncCatalogClient:

0 commit comments

Comments
 (0)