From 3d09e60ced60ea574935235f3fab77109d854aee Mon Sep 17 00:00:00 2001 From: Dale Wahl Date: Wed, 13 Sep 2023 13:24:17 +0200 Subject: [PATCH] fix map_metadata processor on deprecated processors/datasets --- processors/conversion/view_metadata.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/processors/conversion/view_metadata.py b/processors/conversion/view_metadata.py index ab3d53f95..e8b27c87b 100644 --- a/processors/conversion/view_metadata.py +++ b/processors/conversion/view_metadata.py @@ -64,12 +64,13 @@ def process(self): metadata_file = json.load(file) parent_processor = self.dataset.get_parent().get_own_processor() - self.dataset.log(f"Collecting metadata created by {parent_processor.type}") - if not hasattr(parent_processor, "map_metadata"): - self.log.warning(f"Metadata formatter processor cannot run on {parent_processor.type}; has no 'map_metadata' method") - self.dataset.update_status("Cannot reformat metadata", is_final=True) + if parent_processor is None or not hasattr(parent_processor, "map_metadata"): + if parent_processor is not None: + self.log.warning(f"Metadata formatter processor cannot run on {parent_processor.type}; map_metadata method not implemented") + self.dataset.update_status("Cannot reformat metadata for this dataset", is_final=True) self.dataset.finish(0) return + self.dataset.log(f"Collecting metadata created by {parent_processor.type}") include_failed = self.parameters.get("include_failed", False) rows = []