diff --git a/datacube/index/postgres/_datasets.py b/datacube/index/postgres/_datasets.py index abe5407a8..43e3bd2c6 100755 --- a/datacube/index/postgres/_datasets.py +++ b/datacube/index/postgres/_datasets.py @@ -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_)}