From 2dbab735019e3b56278caa2abc84baacd3523e71 Mon Sep 17 00:00:00 2001 From: Julia Lahovnik <126178122+jlahovnik@users.noreply.github.com> Date: Thu, 23 Jan 2025 10:08:08 +0100 Subject: [PATCH] fix(plugins): ECMWFSearch strip_quotes implementation for dicts (#1483) --- eodag/plugins/search/build_search_result.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eodag/plugins/search/build_search_result.py b/eodag/plugins/search/build_search_result.py index 143a93f3a..31d200ee1 100644 --- a/eodag/plugins/search/build_search_result.py +++ b/eodag/plugins/search/build_search_result.py @@ -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 @@ -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("'\"")