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)