Skip to content

Commit 400fa0c

Browse files
committed
stores: check for None
1 parent b932f65 commit 400fa0c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cubedash/summary/_stores.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,12 +1386,13 @@ def _database_time_now(self) -> datetime:
13861386
"""
13871387
return self.e_index.execute_query(select(func.now())).scalar()
13881388

1389-
def _newest_known_dataset_addition_time(self, product_name: str) -> datetime:
1389+
def _newest_known_dataset_addition_time(self, product_name: str) -> datetime | None:
13901390
"""
13911391
Of all the datasets that are present in Explorer's own tables, when
13921392
was the most recent one indexed to ODC?
13931393
"""
1394-
return self.e_index.latest_dataset_added_time(self.get_product(product_name).id)
1394+
id_ = self.get_product(product_name).id
1395+
return None if id_ is None else self.e_index.latest_dataset_added_time(id_)
13951396

13961397
def _mark_product_refresh_completed(
13971398
self, product: ProductSummary, refresh_timestamp: datetime

0 commit comments

Comments
 (0)