From 3e1cd1c815d017a7d059847f03133b207b77d933 Mon Sep 17 00:00:00 2001 From: Antoine MAZEAS Date: Mon, 18 May 2026 17:09:00 +0200 Subject: [PATCH 1/3] null checks in config hint search Signed-off-by: Antoine MAZEAS --- pyoaev/configuration/sources.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyoaev/configuration/sources.py b/pyoaev/configuration/sources.py index 43a5b88..d97d287 100644 --- a/pyoaev/configuration/sources.py +++ b/pyoaev/configuration/sources.py @@ -14,7 +14,7 @@ def get(cls, env_var: str) -> str | None: :return: value of the env var, or None if not found :rtype: str | None """ - return os.getenv(env_var) + return os.getenv(env_var) if env_var else None class DictionarySource: @@ -34,6 +34,9 @@ def get(cls, config_key_path: list[str], source_dict: dict) -> str | None: :return: value for the config key at specified path, or None if not found :rtype: str | None """ + if(config_key_path is None): + return None + assert ( isinstance(config_key_path, list) and len(config_key_path) == 2 From e87661701044abd01ea074a302d1164325494665 Mon Sep 17 00:00:00 2001 From: Antoine MAZEAS Date: Mon, 18 May 2026 17:12:38 +0200 Subject: [PATCH 2/3] fix type hint Signed-off-by: Antoine MAZEAS --- pyoaev/configuration/sources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyoaev/configuration/sources.py b/pyoaev/configuration/sources.py index d97d287..1d64122 100644 --- a/pyoaev/configuration/sources.py +++ b/pyoaev/configuration/sources.py @@ -23,7 +23,7 @@ class DictionarySource: # this is quite hacky # it only strictly handles two levels of keys in a dict @classmethod - def get(cls, config_key_path: list[str], source_dict: dict) -> str | None: + def get(cls, config_key_path: list[str] | None, source_dict: dict) -> str | None: """Gets the value for the specified env var :param config_key_path: the two-level dictionary path to the config key From 40a738b386525520bbb568a4f202354d7907a68e Mon Sep 17 00:00:00 2001 From: Antoine MAZEAS Date: Mon, 18 May 2026 17:14:31 +0200 Subject: [PATCH 3/3] formatting Signed-off-by: Antoine MAZEAS --- pyoaev/configuration/sources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyoaev/configuration/sources.py b/pyoaev/configuration/sources.py index 1d64122..aeb5385 100644 --- a/pyoaev/configuration/sources.py +++ b/pyoaev/configuration/sources.py @@ -34,7 +34,7 @@ def get(cls, config_key_path: list[str] | None, source_dict: dict) -> str | None :return: value for the config key at specified path, or None if not found :rtype: str | None """ - if(config_key_path is None): + if config_key_path is None: return None assert (