From ca23ff680cec7999047e005604b0b7b6ffb114e7 Mon Sep 17 00:00:00 2001 From: Jose Miguel Rodriguez Naranjo Date: Thu, 27 Jun 2024 15:59:17 +0200 Subject: [PATCH] Improve store_key_in_storage --- toolium/utils/dataset.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/toolium/utils/dataset.py b/toolium/utils/dataset.py index 55b2a6d6..05c597b0 100644 --- a/toolium/utils/dataset.py +++ b/toolium/utils/dataset.py @@ -837,13 +837,11 @@ def store_key_in_storage(context, key, value): acccepted_context_types = ["FEATURE", "RUN"] assert context_type in acccepted_context_types, (f"Invalid key: {context_key}. " f"Accepted keys: {acccepted_context_types}") - - if context_type == "FEATURE": - context.feature_storage[context_key] = value - context.storage.update(context.feature_storage) - elif context_type == "RUN": + if context_type == "RUN": context.run_storage[context_key] = value - context.feature_storage.update(context.run_storage) - context.storage.update(context.feature_storage) + context.feature_storage[context_key] = value + elif context_type == "FEATURE": + context.feature_storage[context_key] = value + context.storage[context_key] = value else: context.storage[clean_key] = value