Skip to content

Commit

Permalink
Fix bug in memory driver implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
SpacemanPaul committed Jan 24, 2024
1 parent 74c5cfd commit f41718f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion datacube/index/memory/_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ def temporal_extent(
elif product is not None:
if isinstance(product, str):
product = self._index.products.get_by_name_unsafe(product)
ids = self.by_product.get(product, [])
ids = self.by_product.get(product.name, [])

min_time: Optional[datetime.datetime] = None
max_time: Optional[datetime.datetime] = None
Expand Down
3 changes: 2 additions & 1 deletion integration_tests/index/test_memory_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,8 @@ def test_temporal_extent(mem_eo3_data: ODCEnvironment):
assert (tmin is None and tmax is None) or tmin < tmax
tmin2, tmax2 = dc.index.datasets.temporal_extent(product=ds.product)
assert tmin2 == tmin and tmax2 == tmax
tmin2, tmax2 = dc.index.datasets.temporal_extent(ids=[ds.id])
ids = [doc["id"] for prod, doc, uris in dc.index.datasets.get_all_docs_for_product(product=ds.product)]
tmin2, tmax2 = dc.index.datasets.temporal_extent(ids=ids)
assert tmin2 == tmin and tmax2 == tmax


Expand Down

0 comments on commit f41718f

Please sign in to comment.