From 16c5f1c564e4246b8e7cc002deace5763b0d7329 Mon Sep 17 00:00:00 2001 From: Mahmoud Mabrouk Date: Thu, 30 May 2024 13:07:50 +0200 Subject: [PATCH 1/2] Fixes warning --- agenta-cli/agenta/sdk/types.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/agenta-cli/agenta/sdk/types.py b/agenta-cli/agenta/sdk/types.py index 497cbdec39..a133d785f7 100644 --- a/agenta-cli/agenta/sdk/types.py +++ b/agenta-cli/agenta/sdk/types.py @@ -131,8 +131,7 @@ class GroupedMultipleChoiceParam(str): def __new__(cls, default: str = None, choices: Dict[str, List[str]] = None): if choices is None: choices = {} - - if default and not any(default in choices for choices in choices.values()): + if default and not any(default in choice_list for choice_list in choices.values()): if not choices: print( f"Warning: Default value {default} provided but choices are empty." From b2a8ee9748ae1f50f115f4e36eb762720b5343cf Mon Sep 17 00:00:00 2001 From: Mahmoud Mabrouk Date: Thu, 30 May 2024 13:10:19 +0200 Subject: [PATCH 2/2] format --- agenta-cli/agenta/sdk/types.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/agenta-cli/agenta/sdk/types.py b/agenta-cli/agenta/sdk/types.py index a133d785f7..cf6b47217b 100644 --- a/agenta-cli/agenta/sdk/types.py +++ b/agenta-cli/agenta/sdk/types.py @@ -131,7 +131,9 @@ class GroupedMultipleChoiceParam(str): def __new__(cls, default: str = None, choices: Dict[str, List[str]] = None): if choices is None: choices = {} - if default and not any(default in choice_list for choice_list in choices.values()): + if default and not any( + default in choice_list for choice_list in choices.values() + ): if not choices: print( f"Warning: Default value {default} provided but choices are empty."