Skip to content

Commit

Permalink
fix map_metadata processor on deprecated processors/datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
dale-wahl committed Sep 13, 2023
1 parent deb4a76 commit 3d09e60
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions processors/conversion/view_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down

0 comments on commit 3d09e60

Please sign in to comment.