Skip to content

Commit ff0e56d

Browse files
committed
update migrate
Signed-off-by: Kevin Su <pingsutw@apache.org>
1 parent 7c3edfc commit ff0e56d

7 files changed

Lines changed: 10 additions & 11 deletions

File tree

flytekit/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@
9999
- BlobType
100100
101101
"""
102-
import flytekit.migrate # isort: skip
103-
104102
import os
105103
import sys
106104
from typing import Generator
@@ -163,6 +161,7 @@
163161
StructuredDatasetTransformerEngine,
164162
StructuredDatasetType,
165163
)
164+
import flytekit.migrate # isort: skip
166165

167166

168167
def current_context() -> ExecutionParameters:

flytekit/core/workflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1517,7 +1517,7 @@ def wf(name: str = "flyteorg"):
15171517
:param default_options: Default options for the workflow when creating a default launch plan. Currently only
15181518
the labels and annotations are allowed to be set as defaults.
15191519
"""
1520-
1520+
print("in the workflowwwwww")
15211521
def wrapper(fn: Callable[P, FuncOut]) -> PythonFunctionWorkflow:
15221522
workflow_metadata = WorkflowMetadata(on_failure=failure_policy or WorkflowFailurePolicy.FAIL_IMMEDIATELY)
15231523

flytekit/migrate/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
from flytekit.migrate import task, dynamic, workflow # noqa: F401
2-

flytekit/migrate/dynamic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
from typing import Callable, Union
22

3+
from flyte._task import AsyncFunctionTaskTemplate, P, R
4+
35
import flytekit
46

57
import flytekit.migrate
6-
from flyte._task import AsyncFunctionTaskTemplate, P, R
78

89

910
def dynamic_shim(**kwargs) -> Union[AsyncFunctionTaskTemplate, Callable[P, R]]:

flytekit/migrate/task.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def task_shim(
7575
name="flytekit",
7676
resources=Resources(cpu=0.8, memory="800Mi"),
7777
image=image,
78-
cache="enabled" if cache else "disable",
78+
cache="auto" if cache else "disable",
7979
plugin_config=plugin_config,
8080
)
8181
return env.task(retries=retries, pod_template=pod_template_name or pod_template, docs=docs)

flytekit/migrate/workflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import flytekit
2-
32
from flyte import Image, Resources, TaskEnvironment
43

4+
55
env = TaskEnvironment(
66
name="flytekit",
77
resources=Resources(cpu=0.8, memory="800Mi"),

migrate_exmaples/hello.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import logging
2-
32
from flytekit import ImageSpec, dynamic, task, workflow
43

4+
55
image = ImageSpec(apt_packages=["vim"], packages=["pandas"])
66

77

@@ -24,6 +24,6 @@ def wf(name: str):
2424
if __name__ == "__main__":
2525
import flyte
2626
flyte.init_from_config(log_level=logging.DEBUG)
27-
# run = flyte.with_runcontext(log_level=logging.DEBUG).run(wf, name="flyte")
28-
# print(run.name)
29-
# print(run.url)
27+
run = flyte.with_runcontext(log_level=logging.DEBUG).run(wf, name="flyte")
28+
print(run.name)
29+
print(run.url)

0 commit comments

Comments
 (0)