seunggs
03/13/2023, 2:59 PMTypeError: 'Promise' object is not subscriptable
since flyte creates promises during packaging/deployment:
@workflow
def wf(wf_args) -> int:
print(wf_args["x"])
...
Maarten de Jong
03/13/2023, 4:50 PMwf_args["x"]
without issues since that's where the actual Python code runs, and the inputs are deserialized by then.@task
def task(wf_args):
print(wf_args["x"])
@workflow
def workflow(wf_args):
task(wf_args)
seunggs
03/13/2023, 4:51 PMMaarten de Jong
03/13/2023, 4:53 PMflytekit.current_context().execution_id
should do the trickseunggs
03/13/2023, 4:53 PMMaarten de Jong
03/13/2023, 4:53 PMseunggs
03/13/2023, 4:53 PMMaarten de Jong
03/13/2023, 4:53 PMseunggs
03/13/2023, 4:54 PMwith
context to wrap tasks, but with that would like to send in the execution id to match my experiment run id@workflow
def wf(wf_args):
with logger.run(run_id=1) as run:
task1()
Maarten de Jong
03/13/2023, 4:57 PMseunggs
03/13/2023, 4:58 PM@workflow
def wf(wf_args):
with logger.run(run_id=1) as run:
task1_o = task1()
task2_o = task2(x=task1_o)
...
with
outside of the @workflow
?Maarten de Jong
03/13/2023, 5:00 PM@dynamic
def my_experiment(wf_args):
with logger.run(run_id=flytekit.current_context().execution_id) as run:
task1_o = task1(wf_args)
task2_o = task2(x=task1_o)
...
@workflow
def wf(wf_args):
my_experiment(wf_args)
seunggs
03/13/2023, 5:01 PM@dynamic
doesMaarten de Jong
03/13/2023, 5:02 PMseunggs
03/13/2023, 5:05 PMMaarten de Jong
03/13/2023, 5:14 PMseunggs
03/13/2023, 5:16 PM