Skip to content

Commit 2e9029a

Browse files
committed
chg: do not log error for load_strategy if there is no defined 'type' variable in strategy_kwargs because the omission may be intentional. it will be left to the developer to check and handle (strategy is None) if that is not an acceptable outcome.
1 parent 39404f7 commit 2e9029a

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

scitrera_app_framework/core/core.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,10 @@ def load_strategy(v: Variables, parent_type, prefix='STRATEGY', drop_prefix=True
260260
strategy_type_name = strategy_kwargs.pop('type', None) # type: str|None
261261

262262
try:
263-
strategy = get_python_type_by_name(strategy_type_name, parent_type)
263+
strategy = None if strategy_type_name is None else get_python_type_by_name(strategy_type_name, parent_type)
264264
except (ImportError, AttributeError, TypeError, ValueError) as e:
265-
get_logger(v).error('unable to load strategy "%s": %s: %s', strategy_type_name, e.__class__.__name__, e)
265+
get_logger(v).error('unable to load strategy "%s" with prefix "%s": %s: %s',
266+
strategy_type_name, prefix, e.__class__.__name__, e)
266267
strategy = None
267268

268269
return strategy, strategy_kwargs

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="scitrera-app-framework",
8-
version="0.0.47",
8+
version="0.0.48",
99
author="Scitrera LLC",
1010
author_email="[email protected]",
1111
description="Common Application Framework Code and Utilities",

0 commit comments

Comments
 (0)