clean-glass-36808
03/08/2025, 4:30 AMthen
call of a conditional workflow. It is a dummy task that just logs. I searched for open issues but could not find anything. This is on Flytekit 1.14.6. The web UI also crashes when I click on this failed task.
@task # type: ignore [misc]
def skip_task(name: str) -> None:
"""Placeholder skip task for flyte conditional branching."""
logger.info("Skip running %s task", name)
Trace:
Traceback (most recent call last):
File "<redacted>.runfiles/rules_python~~pip~pip_310_flytekit/site-packages/flytekit/core/base_task.py", line 741, in dispatch_execute
native_inputs = self._literal_map_to_python_input(input_literal_map, exec_ctx)
File "<redacted>.runfiles/rules_python~~pip~pip_310_flytekit/site-packages/flytekit/core/base_task.py", line 610, in _literal_map_to_python_input
return TypeEngine.literal_map_to_kwargs(ctx, literal_map, self.python_interface.inputs)
File "<redacted>.runfiles/rules_python~~pip~pip_310_flytekit/site-packages/flytekit/core/utils.py", line 312, in wrapper
return func(*args, **kwargs)
File "<redacted>.runfiles/rules_python~~pip~pip_310_flytekit/site-packages/flytekit/core/type_engine.py", line 1464, in literal_map_to_kwargs
return synced(ctx, lm, python_types, literal_types)
File "<redacted>.runfiles/rules_python~~pip~pip_310_flytekit/site-packages/flytekit/utils/asyn.py", line 100, in wrapped
return self.run_sync(coro_func, *args, **kwargs)
File "<redacted>.runfiles/rules_python~~pip~pip_310_flytekit/site-packages/flytekit/utils/asyn.py", line 93, in run_sync
return self._runner_map[name].run(coro)
File "<redacted>.runfiles/rules_python~~pip~pip_310_flytekit/site-packages/flytekit/utils/asyn.py", line 72, in run
res = fut.result(None)
File "<redacted>.runfiles/rules_python~~python~python_3_10_x86_64-unknown-linux-gnu/lib/python3.10/concurrent/futures/_base.py", line 458, in result
return self.__get_result()
File "<redacted>.runfiles/rules_python~~python~python_3_10_x86_64-unknown-linux-gnu/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
raise self._exception
File "<redacted>.runfiles/rules_python~~pip~pip_310_flytekit/site-packages/flytekit/core/type_engine.py", line 1500, in _literal_map_to_kwargs
TypeEngine.async_to_python_value(ctx, lm.literals[k], python_interface_inputs[k])
KeyError: 'dn0.o0'
Message:
KeyError: 'dn0.o0'
clean-glass-36808
03/08/2025, 4:32 AMclean-glass-36808
03/08/2025, 4:35 AMdn0.o0
in the UI as false
so there is a result value? This would make sense considering the skip_task
is run in the else
clause. So I really don't understand why this issue is happening.careful-australia-19356
03/21/2025, 4:17 PMconditional
block? I wonder if using an echo
task would also help
you achieve a similar goalclean-glass-36808
03/21/2025, 5:36 PM@dynamic # type: ignore [misc]
def trigger_audio_annotation(....) -> None:
result = should_run_audio_annotation(...)
conditional("should_run_audio_annotation").if_(result.is_true()).then(
p=queue_workflow_trigger(....)
).else_().then(skip_task("audio_annotation"))