From 7b897456e92fc7d9006d012ea37f793fa98b27a7 Mon Sep 17 00:00:00 2001 From: reuvenp Date: Tue, 6 Aug 2024 12:39:38 +0300 Subject: [PATCH] Change metadata verification Replace assertion of metadata data types with a warning. --- mct_quantizers/common/metadata.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mct_quantizers/common/metadata.py b/mct_quantizers/common/metadata.py index ed5a947..b2a6a02 100644 --- a/mct_quantizers/common/metadata.py +++ b/mct_quantizers/common/metadata.py @@ -58,8 +58,9 @@ def _validate_metadata_value(value: Any) -> bool: if not all(isinstance(k, str) for k in metadata.keys()): Logger.error('metadata dictionary should only have string keys.') if not all(_validate_metadata_value(v) for v in metadata.values()): - Logger.error('metadata dictionary values should only be strings, integers, floats, lists, ' - 'or dictionaries with appropriate inner values.') + Logger.warning('metadata dictionary values should be strings, integers, floats, lists, ' + 'or dictionaries with appropriate inner values. Other types may cause issues ' + 'with saving/loading the metadata.') if metadata is None: metadata = {}