Hello. We just hit an unusual issue in Flytekit. T...
# flyte-support
c
Hello. We just hit an unusual issue in Flytekit. This task is throwing an error in flytekit. The task is used in the
then
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.
Copy code
@task  # type: ignore [misc]
def skip_task(name: str) -> None:
    """Placeholder skip task for flyte conditional branching."""
    logger.info("Skip running %s task", name)
Copy code
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'
Screenshot 2025-03-07 at 8.32.37 PM.png
I can see the result of
dn0.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.
c
can you share the rest of your wf
conditional
block? I wonder if using an
echo
task would also help you achieve a similar goal
c
Copy code
@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"))