diff --git a/flytekit/tools/translator.py b/flytekit/tools/translator.py index 60c1ef11c7..b208798edb 100644 --- a/flytekit/tools/translator.py +++ b/flytekit/tools/translator.py @@ -455,12 +455,9 @@ def get_serializable_node( # if entity._aliases: # node_model._output_aliases = entity._aliases elif isinstance(entity.flyte_entity, PythonTask): - # handle pod template overrides override_pod_spec = {} - if entity._pod_template is not None and settings.should_fast_serialize(): - # Only call set_command_fn for PythonAutoContainerTask and its subclasses - # ContainerTask doesn't have this method - if not isinstance(entity.flyte_entity, ContainerTask): + if entity._pod_template is not None: + if settings.should_fast_serialize() and not isinstance(entity.flyte_entity, ContainerTask): entity.flyte_entity.set_command_fn(_fast_serialize_command_fn(settings, entity.flyte_entity)) override_pod_spec = _serialize_pod_spec( entity._pod_template, entity.flyte_entity._get_container(settings), settings