Skip to content

Commit 3d09e60

Browse files
committed
fix map_metadata processor on deprecated processors/datasets
1 parent deb4a76 commit 3d09e60

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

processors/conversion/view_metadata.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,13 @@ def process(self):
6464
metadata_file = json.load(file)
6565

6666
parent_processor = self.dataset.get_parent().get_own_processor()
67-
self.dataset.log(f"Collecting metadata created by {parent_processor.type}")
68-
if not hasattr(parent_processor, "map_metadata"):
69-
self.log.warning(f"Metadata formatter processor cannot run on {parent_processor.type}; has no 'map_metadata' method")
70-
self.dataset.update_status("Cannot reformat metadata", is_final=True)
67+
if parent_processor is None or not hasattr(parent_processor, "map_metadata"):
68+
if parent_processor is not None:
69+
self.log.warning(f"Metadata formatter processor cannot run on {parent_processor.type}; map_metadata method not implemented")
70+
self.dataset.update_status("Cannot reformat metadata for this dataset", is_final=True)
7171
self.dataset.finish(0)
7272
return
73+
self.dataset.log(f"Collecting metadata created by {parent_processor.type}")
7374

7475
include_failed = self.parameters.get("include_failed", False)
7576
rows = []

0 commit comments

Comments
 (0)