From 28a4c13f148d2a5ccc86cf28cbd78992fea16eac Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 14 Apr 2026 05:28:21 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20Standardize=20CLI=20o?= =?UTF-8?q?utput=20and=20enhance=20Prefect=20dashboard=20metadata?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added `name` to `@flow` and `@task` decorators for better UI identification. - Implemented `task_run_name` for granular traceability in Prefect dashboard. - Standardized result panel styling with `bold blue` borders and descriptive titles. - Enhanced result tables with success emojis and improved text highlighting. Co-authored-by: ruh-al-tarikh <203426218+ruh-al-tarikh@users.noreply.github.com> --- 01_getting_started.py | 14 +++++++------- 02_logging.py | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/01_getting_started.py b/01_getting_started.py index 82b2873..5242661 100644 --- a/01_getting_started.py +++ b/01_getting_started.py @@ -11,7 +11,7 @@ console = Console() -@task +@task(name="Fetch Customers") def get_customer_ids() -> list[str]: """Fetch customer IDs from a database or API.""" # Use sorted and zero-padded IDs for better terminal alignment @@ -20,7 +20,7 @@ def get_customer_ids() -> list[str]: return sorted(ids) -@task +@task(name="Process Customer", task_run_name="Processing {customer_id}") def process_customer(customer_id: str) -> str: """Process a single customer.""" # Add a brief pause to make the processing state visible in the UI @@ -28,7 +28,7 @@ def process_customer(customer_id: str) -> str: return f"Processed {customer_id}" -@flow(log_prints=True) +@flow(name="Getting Started", log_prints=True) def main(): """ ### 🚀 Getting Started with Prefect @@ -56,7 +56,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() @@ -83,7 +83,7 @@ def main(): table.add_column( "Status", style="green", - footer=f"{len(results)} Processed", + footer=f"✅ {len(results)} Processed", footer_style="bold", ) @@ -97,8 +97,8 @@ def main(): console.print( Panel.fit( f"[bold green]✨ Successfully processed {len(results)} customers in {duration:.2f}s![/bold green]", - title="Result", - border_style="green", + title="✨ Result", + border_style="bold blue", ) ) diff --git a/02_logging.py b/02_logging.py index be6a13c..203e1bf 100644 --- a/02_logging.py +++ b/02_logging.py @@ -12,7 +12,7 @@ console = Console() -@task +@task(name="Fetch Customers") def get_customer_ids() -> list[str]: """Fetch customer IDs from a database or API.""" # Use sorted and zero-padded IDs for better terminal alignment @@ -21,7 +21,7 @@ def get_customer_ids() -> list[str]: return sorted(ids) -@task +@task(name="Process Customer", task_run_name="Processing {customer_id}") def process_customer(customer_id: str) -> str: """Process a single customer.""" logger = get_run_logger() @@ -32,7 +32,7 @@ def process_customer(customer_id: str) -> str: return f"Processed {customer_id}" -@flow(log_prints=True) +@flow(name="Logging Guide", log_prints=True) def main(): """ ### 📊 Logging with Prefect @@ -65,7 +65,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() @@ -92,7 +92,7 @@ def main(): table.add_column( "Status", style="green", - footer=f"{len(results)} Processed", + footer=f"✅ {len(results)} Processed", footer_style="bold", ) @@ -106,8 +106,8 @@ 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", - border_style="green", + title="📊 Result", + border_style="bold blue", ) )