Skip to content

Commit

Permalink
Use object type for execution identifier in ExecutionParameters (#990)
Browse files Browse the repository at this point in the history
Signed-off-by: Yee Hing Tong <[email protected]>
  • Loading branch information
wild-endeavor authored May 6, 2022
1 parent 20b372d commit e2f6cdf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion flytekit/bin/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def setup_execution(
"""
exe_project = get_one_of("FLYTE_INTERNAL_EXECUTION_PROJECT", "_F_PRJ")
exe_domain = get_one_of("FLYTE_INTERNAL_EXECUTION_DOMAIN", "_F_DM")
exe_name = get_one_of("FLYTE_INTERNAL_EXECUTION_NAME", "_F_NM")
exe_name = get_one_of("FLYTE_INTERNAL_EXECUTION_ID", "_F_NM")
exe_wf = get_one_of("FLYTE_INTERNAL_EXECUTION_WORKFLOW", "_F_WF")
exe_lp = get_one_of("FLYTE_INTERNAL_EXECUTION_LAUNCHPLAN", "_F_LP")

Expand Down
4 changes: 2 additions & 2 deletions flytekit/core/context_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def execution_date(self) -> datetime:
return self._execution_date

@property
def execution_id(self) -> str:
def execution_id(self) -> _identifier.WorkflowExecutionIdentifier:
"""
This is the identifier of the workflow execution within the underlying engine. It will be consistent across all
task executions in a workflow or sub-workflow execution.
Expand Down Expand Up @@ -785,7 +785,7 @@ def initialize():
# are already acquainted with
default_context = FlyteContext(file_access=default_local_file_access_provider)
default_user_space_params = ExecutionParameters(
execution_id=str(WorkflowExecutionIdentifier.promote_from_model(default_execution_id)),
execution_id=WorkflowExecutionIdentifier.promote_from_model(default_execution_id),
execution_date=_datetime.datetime.utcnow(),
stats=mock_stats.MockStats(),
logging=user_space_logger,
Expand Down
4 changes: 2 additions & 2 deletions tests/flytekit/unit/core/test_type_hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_default_wf_params_works():
@task
def my_task(a: int):
wf_params = flytekit.current_context()
assert wf_params.execution_id == "ex:local:local:local"
assert str(wf_params.execution_id) == "ex:local:local:local"
assert flyte_tmp_dir in wf_params.raw_output_prefix

my_task(a=3)
Expand All @@ -69,7 +69,7 @@ def test_simple_input_output():
@task
def my_task(a: int) -> typing.NamedTuple("OutputsBC", b=int, c=str):
ctx = flytekit.current_context()
assert ctx.execution_id == "ex:local:local:local"
assert str(ctx.execution_id) == "ex:local:local:local"
return a + 2, "hello world"

assert my_task(a=3) == (5, "hello world")
Expand Down

0 comments on commit e2f6cdf

Please sign in to comment.