Skip to content

Commit

Permalink
support fast register
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <[email protected]>
  • Loading branch information
pingsutw committed Mar 30, 2023
1 parent fee1b22 commit bf25229
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion flytekit/tools/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ def get_serializable_task(

if settings.should_fast_serialize():
# This handles container tasks.
if container and isinstance(entity, (PythonAutoContainerTask, MapPythonTask)):
if container and (
isinstance(entity, PythonAutoContainerTask)
or (isinstance(entity, MapPythonTask) and isinstance(entity.run_task, PythonAutoContainerTask))
):
# For fast registration, we'll need to muck with the command, but on
# ly for certain kinds of tasks. Specifically,
# tasks that rely on user code defined in the container. This should be encapsulated by the auto container
Expand Down
1 change: 1 addition & 0 deletions tests/flytekit/unit/core/test_map_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def test_serialization_with_raw_container(serialization_settings):
assert task_spec.template.custom["minSuccessRatio"] == 1.0
assert task_spec.template.type == "container_array"
assert task_spec.template.task_type_version == 1
assert task_spec.template.container.args is None
assert task_spec.template.container.command == [
"python",
"test.py",
Expand Down

0 comments on commit bf25229

Please sign in to comment.