From ab2f3ab8e6c07325531aa91eac104351ed72f0e2 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 27 Mar 2026 05:29:53 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20Enhance=20Prefect=20f?= =?UTF-8?q?low=20UX=20with=20docstrings=20and=20log=20capturing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added `log_prints=True` to `02_logging.py` to ensure all output is captured in Prefect logs. - Added a descriptive Markdown docstring to the `main` flow to improve information density in the Prefect UI. - Included a success message with emoji for clear visual feedback on flow completion. Co-authored-by: ruh-al-tarikh <203426218+ruh-al-tarikh@users.noreply.github.com> --- 02_logging.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/02_logging.py b/02_logging.py index 92837c6..8b54e8e 100644 --- a/02_logging.py +++ b/02_logging.py @@ -18,11 +18,24 @@ def process_customer(customer_id: str) -> str: return f"Processed {customer_id}" -@flow +@flow(log_prints=True) def main() -> list[str]: + """ + ### 📊 Logging with Prefect + + This flow demonstrates how to use the Prefect logger and capture standard output. + It processes customer data and logs progress at each step. + + **Key Features:** + - Capture standard `print` statements as logs with `log_prints=True`. + - Use the Prefect logger for structured logging in tasks. + - Map tasks across a list of inputs. + """ customer_ids = get_customer_ids() # Map the process_customer task across all customer IDs results = process_customer.map(customer_ids) + + print(f"✅ Successfully processed {len(results)} customers with detailed logging!") return results