diff --git a/datacube/utils/documents.py b/datacube/utils/documents.py index 4d5252a82..1ecbb6ea0 100644 --- a/datacube/utils/documents.py +++ b/datacube/utils/documents.py @@ -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 @@ -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 @@ -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]: diff --git a/integration_tests/conftest.py b/integration_tests/conftest.py index 985b39072..fc0b22072 100644 --- a/integration_tests/conftest.py +++ b/integration_tests/conftest.py @@ -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,