Skip to content

Commit

Permalink
fix(plugins): ECMWFSearch strip_quotes implementation for dicts (#1483)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlahovnik authored Jan 23, 2025
1 parent 045a849 commit 2dbab73
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion eodag/plugins/search/build_search_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ def strip_quotes(value: Any) -> Any:
'abc'
>>> strip_quotes(["'abc'", '"def'])
['abc', 'def']
>>> strip_quotes({"'abc'": 'def"'})
{'abc': 'def'}
:param value: value from which quotes should be removed (should be either str or list)
:return: value without quotes
Expand All @@ -234,7 +236,7 @@ def strip_quotes(value: Any) -> Any:
if isinstance(value, (list, tuple)):
return [strip_quotes(v) for v in value]
elif isinstance(value, dict):
raise NotImplementedError("Dict value is not supported.")
return {strip_quotes(k): strip_quotes(v) for k, v in value.items()}
else:
return str(value).strip("'\"")

Expand Down

0 comments on commit 2dbab73

Please sign in to comment.