Skip to content

Commit

Permalink
None check
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <[email protected]>
  • Loading branch information
pingsutw committed Jun 3, 2024
1 parent 28d4da3 commit 11595a6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions flytekit/tools/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

from flyteidl.admin import schedule_pb2

from flytekit import PythonFunctionTask, SourceCode, ImageSpec
from flytekit.configuration import Image, SerializationSettings
from flytekit import ImageSpec, PythonFunctionTask, SourceCode
from flytekit.configuration import Image, ImageConfig, SerializationSettings
from flytekit.core import constants as _common_constants
from flytekit.core import context_manager
from flytekit.core.array_node_map_task import ArrayNodeMapTask
Expand Down Expand Up @@ -182,6 +182,8 @@ def get_serializable_task(
# 1. Build the ImageSpec for the entities that are inside the dynamic task,
# 2. Add images to the serialization context, so the dynamic task can look it up at runtime.
if isinstance(e.container_image, ImageSpec):
if settings.image_config.images is None:
settings.image_config = ImageConfig.create_from(settings.image_config.default_image)
settings.image_config.images.append(Image.look_up_image_info(f"ft_{e.name}", e.get_image(settings)))

# In case of Dynamic tasks, we want to pass the serialization context, so that they can reconstruct the state
Expand Down

0 comments on commit 11595a6

Please sign in to comment.