From ab7f9c2d5783fb229208bbb6f368460cb0dd82d9 Mon Sep 17 00:00:00 2001 From: maxsibilla Date: Thu, 27 Aug 2026 14:24:12 -0400 Subject: [PATCH] Utilizing ast.literal_eval instead of json.loads to handle metadata that has quotes in it --- src/schema/schema_triggers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/schema/schema_triggers.py b/src/schema/schema_triggers.py index a4aaf8dc..9e86556c 100644 --- a/src/schema/schema_triggers.py +++ b/src/schema/schema_triggers.py @@ -1,3 +1,4 @@ +import ast import json import logging import re @@ -1642,7 +1643,8 @@ def get_source_mapped_metadata( raise schema_errors.InvalidPropertyRequirementsException(msg) if not isinstance(existing_data_dict["metadata"], dict): - metadata = json.loads(existing_data_dict["metadata"].replace("'", '"')) + metadata = ast.literal_eval(existing_data_dict["metadata"]) + # metadata = json.loads(existing_data_dict["metadata"].replace("'", '"')) else: metadata = existing_data_dict["metadata"]