Skip to content

Commit 9cd8e51

Browse files
romain-intelmadhur-ob
authored andcommitted
More fixes for configs
Previously something like: RETRIES = config_expr("settings").retry class MyFlow(FlowSpec): @retries(times=RETRIES) @step def start(self): ... @retries(times=RETRIES) @step def end(self): ... would fail. Also, something like: FOO = config_expr("settings").foo.bar BAR = FOO.BAZ BLAH = FOO.BAZ2 would also fail. This fixes these issues by copying DelayEvaluator everytime and also making the `__call__` function reentrant.
1 parent c706438 commit 9cd8e51

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

metaflow/user_configs/config_parameters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ def __call__(self, ctx=None, deploy_time=False):
377377
# Evaluate the expression setting the config values as local variables
378378
try:
379379
return eval(
380-
self._config_expr,
380+
to_eval_expr,
381381
self._globals or globals(),
382382
{
383383
k: ConfigValue(v)
@@ -387,7 +387,7 @@ def __call__(self, ctx=None, deploy_time=False):
387387
except NameError as e:
388388
raise MetaflowException(
389389
"Config expression '%s' could not be evaluated: %s"
390-
% (self._config_expr, str(e))
390+
% (to_eval_expr, str(e))
391391
) from e
392392

393393

0 commit comments

Comments
 (0)