Ben Muller
06/22/2022, 2:01 AMau_harness_win_place = CronClock(
cron="33 * * * *",
parameter_defaults={
"race_types": ["Harness"],
"market_type_codes": ["WIN", "PLACE"],
"event_type_ids": None,
"market_countries": ["AU"],
"table_name": "harness_market_catalogue_au"
},
start_date=datetime.now(tz=timezone("Australia/Brisbane")),
)
that is called like so
with Flow(
name="betfair_market_catalogues",
storage=Storage.in_a_s3_bucket(),
run_config=RunConfig().fargate_on_ecs(),
schedule=Schedule(clocks=[au_nz_greys_win_place, au_harness_win_place]),
executor=LocalDaskExecutor(scheduler="threads"),
) as flow:
If I want to call this via the cli it doesnt like the None values and the python objects, do I have to accept stringified versions of this or does prefect handle this on its own?
eg, how would I run this locally
prefect run -p flows/market_catalogues/betfair_market_catalogues.py --param table_name="harness_market_catalogue_au" --param race_types=["Harness"] --param market_type_codes=["WIN", "PLACE"] --param event_type_ids=[] --param market_countries=["AU"]
doesnt do the jobKevin Kho
06/22/2022, 2:10 AMBen Muller
06/22/2022, 2:11 AMjson.dumps
around themKevin Kho
06/22/2022, 2:12 AMBen Muller
06/22/2022, 2:12 AMparameter_defaults=
au_harness_win_place = CronClock(
cron="33 * * * *",
parameter_defaults={
"race_types": json.dumps(["Harness"]),
"market_type_codes": json.dumps(["WIN", "PLACE"]),
"event_type_ids": json.dumps(None),
"market_countries": json.dumps(["AU"]),
"table_name": "harness_market_catalogue_au"
},
start_date=datetime.now(tz=timezone("Australia/Brisbane")),
)
Kevin Kho
06/22/2022, 2:14 AMBen Muller
06/22/2022, 2:14 AMKevin Kho
06/22/2022, 2:16 AMwith Flow(..) as flow:
...
if __name__ == "__main__":
flow.run(parameters={..})
and then you can call the register using the CLI but use the main section for ad hoc runs?Ben Muller
06/22/2022, 2:17 AMKevin Kho
06/22/2022, 2:21 AMBen Muller
06/22/2022, 2:21 AM