Amit
08/04/2020, 1:17 PM@task
def task_process_data(date_to_process):
if date_to_process is None:
# calculate
date_to_process = "some_value"
def flow_process_daily_data(*args, **kwargs):
with Flow(*args, **kwargs) as flow:
date_to_process = Parameter('date_to_process', default=None, kind=Parameter.POSITIONAL_OR_KEYWORD)
task_process_daily_data(date_to_process)
return flow
flow_process_daily_data(
name="process-data",
schedule=Schedule(clocks=[CronClock("0 14 */1 * *")]),
storage=storage,
)
# Then I build the storage and register the flow here ..
This flow has no parameters ; Click "Run" to launch your flow!
Also, I don't understand why all the examples of Parameters have flow.run()
called, as I don't call it, since it runs on schedule.Jim Crist-Harif
08/04/2020, 1:37 PMParameter
class has a kind
keyword, where are you importing Parameter
from? Can you add your imports to your example so that I can run it as is?I don't understand why all the examples of Parameters haveParameters (if they have defaults) work fine when run on a schedule, but for simplicity most of our examples usecalled, as I don't call it, since it runs on schedule.flow.run()
flow.run()
since not every user will be running a flow on a schedule.Amit
08/04/2020, 1:41 PMJim Crist-Harif
08/04/2020, 1:42 PM