From 833d7c77995b0a2ecc359d3776efd6d03cdde05e Mon Sep 17 00:00:00 2001 From: Patricia Roman Sanchez Date: Fri, 4 Oct 2024 14:23:57 +0200 Subject: [PATCH] Restore some changes --- toolium/utils/dataset.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/toolium/utils/dataset.py b/toolium/utils/dataset.py index d7bb7c7f..f9d8c022 100644 --- a/toolium/utils/dataset.py +++ b/toolium/utils/dataset.py @@ -27,8 +27,6 @@ import string import uuid - - from ast import literal_eval from copy import deepcopy from inspect import isfunction @@ -648,12 +646,7 @@ def get_value_from_context(param, context): value = value[part] # evaluate if in an array, access is requested by index elif isinstance(value, list) and part.lstrip('-+').isdigit() and int(part) < len(value): - try: - value = value[int(part)] if part.lstrip('-+').isdigit() else value[part] - except (TypeError, KeyError): - value = getattr(value, part) - except AttributeError as exc: - raise AttributeError(context.logger.info) from exc + value = value[int(part)] # or by a key=value expression elif isinstance(value, list) and (element := _select_element_in_list(value, part)): value = element