Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions 01_getting_started.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from prefect import flow, task
from prefect.logger import get_run_logger
import random


@task
def get_customer_ids() -> list[str]:
# Fetch customer IDs from a database or API
Expand All @@ -9,6 +11,9 @@ def get_customer_ids() -> list[str]:
@task
def process_customer(customer_id: str) -> str:
# Process a single customer
logger = get_run_logger()
for _ in range(50):
logger.info(f"Processing customer {customer_id}")
return f"Processed {customer_id}"

@flow
Expand Down