Skip to content

Commit

Permalink
fix: update templates detection in metadata-mapping (#1139)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunato authored May 16, 2024
1 parent 0440f20 commit 8fe2f86
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions eodag/api/product/metadata_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ def properties_from_json(
else:
conversion_or_none, path_or_text = value
if isinstance(path_or_text, str):
if re.search(r"({[^{}]+})+", path_or_text):
if re.search(r"({[^{}:]+})+", path_or_text):
templates[metadata] = path_or_text
else:
properties[metadata] = path_or_text
Expand Down Expand Up @@ -922,7 +922,7 @@ def properties_from_json(
conversion_or_none = conversion_or_none[0]

# check if conversion uses variables to format
if re.search(r"({[^{}]+})+", conversion_or_none):
if re.search(r"({[^{}:]+})+", conversion_or_none):
conversion_or_none = conversion_or_none.format(**properties)

properties[metadata] = format_metadata(
Expand Down Expand Up @@ -1106,7 +1106,7 @@ def properties_from_xml(
conversion_or_none = conversion_or_none[0]

# check if conversion uses variables to format
if re.search(r"({[^{}]+})+", conversion_or_none):
if re.search(r"({[^{}:]+})+", conversion_or_none):
conversion_or_none = conversion_or_none.format(**properties)

properties[metadata] = [
Expand All @@ -1128,7 +1128,7 @@ def properties_from_xml(
# formatting resolution using previously successfully resolved properties
# Ignore any transformation specified. If a value is to be passed as is,
# we don't want to transform it further
if re.search(r"({[^{}]+})+", path_or_text):
if re.search(r"({[^{}:]+})+", path_or_text):
templates[metadata] = path_or_text
else:
properties[metadata] = path_or_text
Expand Down

0 comments on commit 8fe2f86

Please sign in to comment.