Skip to content

Commit

Permalink
use constant and fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Yee Hing Tong <[email protected]>
  • Loading branch information
wild-endeavor committed Feb 27, 2025
1 parent 6ac8010 commit 3db4249
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion flytekit/core/python_function_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@

T = TypeVar("T")

CLEANUP_LOOP_DELAY_SECONDS = 1


class PythonInstanceTask(PythonAutoContainerTask[T], ABC): # type: ignore
"""
Expand Down Expand Up @@ -748,7 +750,7 @@ def dispatch_execute(self, ctx: FlyteContext, input_literal_map: LiteralMap) ->
for exec_model in exec_models:
logger.warning(f"Terminating execution {exec_model.id}, phase {exec_model.closure.phase}")
remote.client.terminate_execution(exec_model.id, f"clean up by parent eager execution {name}")
time.sleep(0.5)
time.sleep(CLEANUP_LOOP_DELAY_SECONDS)

# Just echo back
return input_literal_map
Expand Down
2 changes: 1 addition & 1 deletion tests/flytekit/unit/core/test_imperative.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def t2():
@task
def t3(dc: DC) -> DC:
if dc.string is None:
DC(string="default")
return DC(string="default")
return DC(string=dc.string + " world") # type: ignore[operator]

wb = ImperativeWorkflow(name="my.workflow.a")
Expand Down

0 comments on commit 3db4249

Please sign in to comment.