Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ByronHsu committed Jan 26, 2023
1 parent 6711714 commit 1f38a80
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion flytekit/core/pod_template.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
from dataclasses import dataclass
from kubernetes.client.models import V1PodSpec
from typing import Dict, Optional

from kubernetes.client.models import V1PodSpec

from flytekit.exceptions import user as _user_exceptions

PRIMARY_CONTAINER_DEFAULT_NAME = "primary"


@dataclass
class PodTemplate(object):
pod_spec: V1PodSpec
Expand Down
1 change: 1 addition & 0 deletions flytekit/models/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ def from_flyte_idl(cls, pb2_object):
discovery_version=pb2_object.discovery_version,
deprecated_error_message=pb2_object.deprecated_error_message,
cache_serializable=pb2_object.cache_serializable,
pod_template_name=pb2_object.pod_template_name,
)


Expand Down
6 changes: 5 additions & 1 deletion tests/flytekit/unit/models/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def test_task_metadata():
"0.1.1b0",
"This is deprecated!",
True,
"A",
)

assert obj.discoverable is True
Expand All @@ -82,6 +83,7 @@ def test_task_metadata():
assert obj.runtime.version == "1.0.0"
assert obj.deprecated_error_message == "This is deprecated!"
assert obj.discovery_version == "0.1.1b0"
assert obj.pod_template_name == "A"
assert obj == task.TaskMetadata.from_flyte_idl(obj.to_flyte_idl())


Expand Down Expand Up @@ -134,6 +136,7 @@ def test_task_spec():
"0.1.1b0",
"This is deprecated!",
True,
"A",
)

int_type = types.LiteralType(types.SimpleType.INTEGER)
Expand Down Expand Up @@ -178,7 +181,7 @@ def test_task_spec():
assert obj.template == template


def test_task_template__k8s_pod_target():
def test_task_template_k8s_pod_target():
int_type = types.LiteralType(types.SimpleType.INTEGER)
obj = task.TaskTemplate(
identifier.Identifier(identifier.ResourceType.TASK, "project", "domain", "name", "version"),
Expand All @@ -192,6 +195,7 @@ def test_task_template__k8s_pod_target():
"1.0",
"deprecated",
False,
"A",
),
interface_models.TypedInterface(
# inputs
Expand Down
1 change: 1 addition & 0 deletions tests/flytekit/unit/models/test_workflow_closure.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def test_workflow_closure():
"0.1.1b0",
"This is deprecated!",
True,
"A",
)

cpu_resource = _task.Resources.ResourceEntry(_task.Resources.ResourceName.CPU, "1")
Expand Down

0 comments on commit 1f38a80

Please sign in to comment.