Skip to content

Commit 793ca45

Browse files
fix(translator): serialize pod_spec for node overrides regardless of fast_serialize
The pod_spec in TaskNodeOverrides was only serialized when should_fast_serialize() was True. This meant dynamic tasks with pod_template overrides (via with_overrides) would produce an empty pod_spec in the DynamicJobSpec when fast_serialize was disabled, causing the propeller to fail to schedule the child task (UNKNOWN status). Aligns with upstream flytekit behavior: always serialize pod_spec when a pod_template override exists; only gate set_command_fn behind should_fast_serialize(). Co-Authored-By: benchan@exa.ai <ben@vervious.com>
1 parent f31e414 commit 793ca45

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

flytekit/tools/translator.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -455,12 +455,9 @@ def get_serializable_node(
455455
# if entity._aliases:
456456
# node_model._output_aliases = entity._aliases
457457
elif isinstance(entity.flyte_entity, PythonTask):
458-
# handle pod template overrides
459458
override_pod_spec = {}
460-
if entity._pod_template is not None and settings.should_fast_serialize():
461-
# Only call set_command_fn for PythonAutoContainerTask and its subclasses
462-
# ContainerTask doesn't have this method
463-
if not isinstance(entity.flyte_entity, ContainerTask):
459+
if entity._pod_template is not None:
460+
if settings.should_fast_serialize() and not isinstance(entity.flyte_entity, ContainerTask):
464461
entity.flyte_entity.set_command_fn(_fast_serialize_command_fn(settings, entity.flyte_entity))
465462
override_pod_spec = _serialize_pod_spec(
466463
entity._pod_template, entity.flyte_entity._get_container(settings), settings

0 commit comments

Comments
 (0)