Skip to content

Commit

Permalink
fix postgres ds get_unsafe return type
Browse files Browse the repository at this point in the history
  • Loading branch information
Ariana Barzinpour committed Oct 23, 2024
1 parent 0650c4c commit 0de2e24
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion datacube/index/postgres/_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ def get_unsafe(self, id_: DSID, include_sources: bool = False,
with self._db_connection() as connection:
if not include_sources:
dataset = connection.get_dataset(id_)
return self._make(dataset, full_info=True) if dataset else None
if not dataset:
raise KeyError(id_)
return self._make(dataset, full_info=True)

datasets = {result.id: (self._make(result, full_info=True), result)
for result in connection.get_dataset_sources(id_)}
Expand Down

0 comments on commit 0de2e24

Please sign in to comment.