Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion 01_getting_started.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
console = Console()


@task(name="Fetch Customers")
@task(name="Fetch Customer IDs")
def get_customer_ids() -> list[str]:
"""Fetch customer IDs from a database or API."""
Expand All @@ -20,6 +21,7 @@ def get_customer_ids() -> list[str]:
return sorted(ids)


@task(name="Process Customer", task_run_name="Processing {customer_id}")
@task(name="Process Customer", task_run_name="Process {customer_id}")
def process_customer(customer_id: str) -> str:
"""Process a single customer."""
Expand All @@ -28,6 +30,7 @@ def process_customer(customer_id: str) -> str:
return f"Processed {customer_id}"


@flow(name="Getting Started", log_prints=True)
@flow(name="Getting Started Flow", log_prints=True)
def main():
"""
Expand Down Expand Up @@ -56,7 +59,7 @@ def main():
customer_ids = get_customer_ids()

console.print(
f"[bold blue]πŸ“¦ Successfully fetched {len(customer_ids)} customer IDs[/bold blue]"
f"[bold blue]πŸ“¦ Successfully fetched [bold cyan]{len(customer_ids)}[/bold cyan] customer IDs[/bold blue]"
)
console.print()

Expand Down Expand Up @@ -97,6 +100,7 @@ def main():
console.print(
Panel.fit(
f"[bold green]✨ Successfully processed {len(results)} customers in {duration:.2f}s![/bold green]",
title="✨ Result",
title="✨ Workflow Results",
border_style="bold blue",
)
Expand Down
6 changes: 5 additions & 1 deletion 02_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
console = Console()


@task(name="Fetch Customers")
@task(name="Fetch Customer IDs")
def get_customer_ids() -> list[str]:
"""Fetch customer IDs from a database or API."""
Expand All @@ -21,6 +22,7 @@ def get_customer_ids() -> list[str]:
return sorted(ids)


@task(name="Process Customer", task_run_name="Processing {customer_id}")
@task(name="Process Customer", task_run_name="Process {customer_id}")
def process_customer(customer_id: str) -> str:
"""Process a single customer."""
Expand All @@ -32,6 +34,7 @@ def process_customer(customer_id: str) -> str:
return f"Processed {customer_id}"


@flow(name="Logging Guide", log_prints=True)
@flow(name="Logging Demo Flow", log_prints=True)
def main():
"""
Expand Down Expand Up @@ -65,7 +68,7 @@ def main():
customer_ids = get_customer_ids()

console.print(
f"[bold blue]πŸ“¦ Successfully fetched {len(customer_ids)} customer IDs[/bold blue]"
f"[bold blue]πŸ“¦ Successfully fetched [bold cyan]{len(customer_ids)}[/bold cyan] customer IDs[/bold blue]"
)
console.print()

Expand Down Expand Up @@ -106,6 +109,7 @@ def main():
console.print(
Panel.fit(
f"[bold green]✨ Successfully processed {len(results)} customers with detailed logging in {duration:.2f}s![/bold green]",
title="πŸ“Š Result",
title="πŸ“Š Workflow Results",
border_style="bold blue",
)
Expand Down
Loading