We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2010a0b commit 97d9870Copy full SHA for 97d9870
api/py/test/sample/group_bys/quickstart/purchases.py
@@ -15,6 +15,7 @@
15
from ai.chronon.api.ttypes import Source, EventSource
16
from ai.chronon.query import Query, select
17
from ai.chronon.group_by import GroupBy, Aggregation, Operation
18
+from ai.chronon.api.ttypes import StagingQuery, MetaData
19
20
"""
21
This GroupBy aggregates metrics about a user's previous purchases in various windows.
@@ -67,3 +68,25 @@
67
68
),
69
],
70
)
71
+
72
73
+query = """
74
+SELECT
75
+ ts,
76
+ ds,
77
+ purchase_id,
78
+ user_id,
79
+ product_id,
80
+ purchase_price
81
+FROM data.purchases
82
+WHERE ds BETWEEN '{{ start_date }}' AND '{{ end_date }}'
83
+"""
84
85
+staging_query = StagingQuery(
86
+ query=query,
87
+ startPartition="2023-10-31",
88
+ metaData=MetaData(
89
+ name='purchases_staging_query',
90
+ outputNamespace="data"
91
+ )
92
+)
0 commit comments