[e988c2]: / tests / generative / example.py

Download this file

27 lines (23 with data), 553 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# A tiny example of a generative test case defined in a standalone file so that we can
# check that the `test_query_model_example_file` function works correctly
from ehrql.query_model.nodes import (
AggregateByPatient,
Column,
Dataset,
SelectColumn,
SelectPatientTable,
TableSchema,
)
p0 = SelectPatientTable(
"p0",
TableSchema(
i1=Column(int),
),
)
dataset = Dataset(
population=AggregateByPatient.Exists(p0),
variables={"v": SelectColumn(p0, "i1")},
events={},
measures=None,
)
data = []