Skip to content

Commit

Permalink
fix lineage when adding postgis datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
Ariana Barzinpour committed Dec 12, 2024
1 parent 3e45a05 commit d8c41c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions datacube/utils/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
from copy import deepcopy
from uuid import UUID

from deprecat import deprecat

import numpy
import toolz # type: ignore[import]
import yaml
Expand Down Expand Up @@ -440,6 +438,9 @@ def sources(self):
# sources aren't expected to be embedded documents anymore
self._sources = {k: SimpleDocNav(v) if isinstance(v, collections.abc.Mapping) else v
for k, v in get_doc_offset(self._sources_path, self._doc, {}).items()}
# if we have sources but they are at (lineage) rather than (lineage, source_datasets)
if not self._sources and self._doc.get('lineage'):
self._sources = self._doc['lineage']
return self._sources

@property
Expand Down Expand Up @@ -531,7 +532,6 @@ def fields(self):
return {**self.system_fields, **self.search_fields}


@deprecat(deprecated_args={'inplace': {'version': '1.9.0', 'reason': 'not being used'}})
def without_lineage_sources(doc: Dict[str, Any],
spec,
inplace: bool = False) -> Dict[str, Any]:
Expand Down
4 changes: 1 addition & 3 deletions integration_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,8 @@ def ds_no_region(index, extended_eo3_metadata_type, ls8_eo3_product, final_datas


@pytest.fixture
def ds_with_lineage(index, wo_eo3_product, eo3_wo_dataset_doc, ls8_eo3_dataset):
def ds_with_lineage(index, wo_eo3_product, eo3_wo_dataset_doc):
doc, path = eo3_wo_dataset_doc
# rewrite lineage to correct format
doc["lineage"] = {"source_datasets": {"ard": [ls8_eo3_dataset.id]}}
return doc_to_ds_no_add(
index,
wo_eo3_product.name,
Expand Down

0 comments on commit d8c41c1

Please sign in to comment.