worried-lighter-79998
04/20/2022, 9:17 AMimport numpy as np
from flytekit import workflow
@workflow
def wf(date: str = "2022-01-01"):
date = np.datetime64(date) # this errorsboundless-pizza-95864
04/20/2022, 12:25 PMfrom datetime import datetime
@task
def t(date: datetime):
date = np.datetime64(date)
...
@workflows
def wf(date: datetime = datetime(2022,1,1)):
t(date=date)broad-monitor-993
04/20/2022, 1:52 PM@task and @workflow is that you can think of @task as a regular python function, whereas the code within a @workflow is actually execution graph constructor language.
So @task functions implements the code that does some unit of work, whereas @workflow functions define the logic of how to put multiple tasks (units of work) together in some sequencebroad-monitor-993
04/20/2022, 1:55 PM@task functions (maybe even a single task)
• then string those tasks together into a @workflow, much like how you might define a main function to tie all of the functions in your module together into a single command.broad-monitor-993
04/20/2022, 1:56 PMworried-lighter-79998
04/21/2022, 8:16 AMbroad-monitor-993
04/25/2022, 1:27 PMworried-lighter-79998
05/18/2022, 7:36 AM