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
7 changes: 5 additions & 2 deletions 01_getting_started.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion 02_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
Loading