Koen
01/15/2025, 2:12 PMMarvin
01/15/2025, 2:12 PMpython
from prefect import flow
@flow
def my_flow(configs: list[dict] = None):
if configs is None:
configs = [{'CFG_ID': 1, 'CFG': {'job_id': 12, 'job_params': {'test': 5}}}]
# Your flow logic here
print(configs)
# Example of running the flow
my_flow()
In this example, the configs
parameter is optional, and if not provided, it defaults to a pre-defined list of dictionaries. Prefect automatically handles type conversion using type hints, so your list of dictionaries will be correctly interpreted.
For more details, you might find these resources useful:
- Writing Flows in Prefect 3.x
- Prefect GitHub Repository
Let me know if you have any further questions or need clarification!