From ed82212eecfd2f7d3fc5a082cd89fcacf7c98f6f Mon Sep 17 00:00:00 2001 From: Deepak Chandan Date: Wed, 17 Jan 2024 17:02:09 -0500 Subject: [PATCH] fix issue --- STACpopulator/input.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/STACpopulator/input.py b/STACpopulator/input.py index 43ef8bb..097c681 100644 --- a/STACpopulator/input.py +++ b/STACpopulator/input.py @@ -146,7 +146,6 @@ def __iter__(self) -> Iterator[Tuple[str, str, MutableMapping[str, Any]]]: for item_name, ds in self.catalog_head.datasets.items(): attrs = self.extract_metadata(ds) yield item_name, ds.url_path, attrs - # yield item_name, ds.url_path, [] for name, ref in self.catalog_head.catalog_refs.items(): self.catalog_head = ref.follow() @@ -208,7 +207,7 @@ def __iter__(self) -> Iterator[Tuple[str, MutableMapping[str, Any]]]: if self.prune: # stop recursive search if requested del dirs[:] col_path = os.path.join(root, self._collection_name) - yield col_path, self._load_json(col_path) + yield col_path, "", self._load_json(col_path) # if a collection is found deeper when not expected for items parsing # drop the nested directories to avoid over-crawling nested collections elif not self._collection_mode and not is_root and self._collection_name in files: @@ -218,7 +217,7 @@ def __iter__(self) -> Iterator[Tuple[str, MutableMapping[str, Any]]]: for name in files: if not self._collection_mode and self._is_item(name): item_path = os.path.join(root, name) - yield item_path, self._load_json(item_path) + yield item_path, "", self._load_json(item_path) def _is_item(self, path: Union[os.PathLike[str], str]) -> bool: name = os.path.split(path)[-1]