From 951878b679e710aad1ac83adebd4194891a85133 Mon Sep 17 00:00:00 2001 From: Becky Smith Date: Wed, 27 Nov 2024 17:11:07 +0000 Subject: [PATCH] Clarify the debug example Add some comments and more explicit variable names so it's clearer what we're debugging in the example --- docs_src/dummy_data_in_opensafely.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs_src/dummy_data_in_opensafely.md b/docs_src/dummy_data_in_opensafely.md index c07c7a9..1f81039 100644 --- a/docs_src/dummy_data_in_opensafely.md +++ b/docs_src/dummy_data_in_opensafely.md @@ -175,9 +175,12 @@ csv files corresponding to the two tables that this dataset definition uses. ```py from ehrql import create_dataset, debug ... + # show the date column from the original clinical_events table debug(clinical_events.date) - events = clinical_events.sort_by(clinical_events.date).first_for_patient() - debug(events.date) + # filter to a patient frame, with the first event for each patient + first_events = clinical_events.sort_by(clinical_events.date).first_for_patient() + # show the date column from the filtered first_events frame + debug(first_events.date) ... ```