From ff44901b1f7dcdd1706b8f6a884c157acc965ae6 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 05:18:28 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20Refine=20demo=20data?= =?UTF-8?q?=20uniqueness=20and=20CLI=20visual=20hierarchy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Changed `random.choices` to `random.sample` in `get_customer_ids` for unique mock data. - Added `time.sleep(0.1)` to `get_customer_ids` for perceptible status spinners. - Removed redundant prefix from "Next Step" guidance in `01_getting_started.py`. - Verified changes by running both demo scripts and performing lint/type checks. Co-authored-by: ruh-al-tarikh <203426218+ruh-al-tarikh@users.noreply.github.com> --- 01_getting_started.py | 7 +++++-- 02_logging.py | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/01_getting_started.py b/01_getting_started.py index a9bcdce..a522ce2 100644 --- a/01_getting_started.py +++ b/01_getting_started.py @@ -14,7 +14,10 @@ def get_customer_ids() -> list[str]: """Fetch customer IDs from a database or API.""" # Use sorted and zero-padded IDs for better terminal alignment - ids = [f"customer-{n:02d}" for n in random.choices(range(100), k=5)] + # Use random.sample to ensure unique customer IDs in the demo + ids = [f"customer-{n:02d}" for n in random.sample(range(100), k=5)] + # Add a brief pause to make the fetching state visible in the UI + time.sleep(0.1) return sorted(ids) @@ -93,7 +96,7 @@ def main(): console.print(Rule("Next Step", style="blue")) console.print( - "[bold blue]➡️ Next Step:[/bold blue] Try running [cyan]python 02_logging.py[/cyan] to learn about logging in Prefect!" + "Try running [cyan]python 02_logging.py[/cyan] to learn about logging in Prefect!" ) return results diff --git a/02_logging.py b/02_logging.py index f5e6ab6..c8920b8 100644 --- a/02_logging.py +++ b/02_logging.py @@ -15,7 +15,10 @@ def get_customer_ids() -> list[str]: """Fetch customer IDs from a database or API.""" # Use sorted and zero-padded IDs for better terminal alignment - ids = [f"customer-{n:02d}" for n in random.choices(range(100), k=5)] + # Use random.sample to ensure unique customer IDs in the demo + ids = [f"customer-{n:02d}" for n in random.sample(range(100), k=5)] + # Add a brief pause to make the fetching state visible in the UI + time.sleep(0.1) return sorted(ids)