awx-zipline-ai 0.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of awx-zipline-ai might be problematic. Click here for more details.
- awx_zipline_ai-0.3.4/PKG-INFO +196 -0
- awx_zipline_ai-0.3.4/README.md +142 -0
- awx_zipline_ai-0.3.4/pyproject.toml +23 -0
- awx_zipline_ai-0.3.4/setup.cfg +4 -0
- awx_zipline_ai-0.3.4/src/__init__.py +0 -0
- awx_zipline_ai-0.3.4/src/agent/__init__.py +1 -0
- awx_zipline_ai-0.3.4/src/agent/constants.py +15 -0
- awx_zipline_ai-0.3.4/src/agent/ttypes.py +1684 -0
- awx_zipline_ai-0.3.4/src/ai/__init__.py +0 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/__init__.py +0 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/airflow_helpers.py +248 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/cli/__init__.py +0 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/cli/compile/__init__.py +0 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/cli/compile/column_hashing.py +336 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/cli/compile/compile_context.py +173 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/cli/compile/compiler.py +183 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/cli/compile/conf_validator.py +742 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/cli/compile/display/__init__.py +0 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/cli/compile/display/class_tracker.py +102 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/cli/compile/display/compile_status.py +95 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/cli/compile/display/compiled_obj.py +12 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/cli/compile/display/console.py +3 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/cli/compile/display/diff_result.py +111 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/cli/compile/fill_templates.py +35 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/cli/compile/parse_configs.py +134 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/cli/compile/parse_teams.py +242 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/cli/compile/serializer.py +109 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/cli/compile/version_utils.py +42 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/cli/git_utils.py +145 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/cli/logger.py +59 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/constants.py +3 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/group_by.py +692 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/join.py +580 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/logger.py +23 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/model.py +40 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/query.py +126 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/repo/__init__.py +39 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/repo/aws.py +284 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/repo/cluster.py +136 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/repo/compile.py +62 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/repo/constants.py +164 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/repo/default_runner.py +270 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/repo/explore.py +418 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/repo/extract_objects.py +134 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/repo/gcp.py +586 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/repo/gitpython_utils.py +15 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/repo/hub_runner.py +261 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/repo/hub_uploader.py +109 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/repo/init.py +60 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/repo/join_backfill.py +119 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/repo/run.py +302 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/repo/serializer.py +133 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/repo/team_json_utils.py +46 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/repo/utils.py +481 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/repo/zipline.py +35 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/repo/zipline_hub.py +277 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/resources/__init__.py +0 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/resources/gcp/__init__.py +0 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/resources/gcp/group_bys/__init__.py +0 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/resources/gcp/group_bys/test/__init__.py +0 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/resources/gcp/group_bys/test/data.py +30 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/resources/gcp/joins/__init__.py +0 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/resources/gcp/joins/test/__init__.py +0 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/resources/gcp/joins/test/data.py +26 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/resources/gcp/sources/__init__.py +0 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/resources/gcp/sources/test/__init__.py +0 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/resources/gcp/sources/test/data.py +26 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/resources/gcp/teams.py +58 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/source.py +86 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/staging_query.py +226 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/types.py +58 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/utils.py +510 -0
- awx_zipline_ai-0.3.4/src/ai/chronon/windows.py +48 -0
- awx_zipline_ai-0.3.4/src/awx_zipline_ai.egg-info/PKG-INFO +196 -0
- awx_zipline_ai-0.3.4/src/awx_zipline_ai.egg-info/SOURCES.txt +99 -0
- awx_zipline_ai-0.3.4/src/awx_zipline_ai.egg-info/dependency_links.txt +1 -0
- awx_zipline_ai-0.3.4/src/awx_zipline_ai.egg-info/entry_points.txt +2 -0
- awx_zipline_ai-0.3.4/src/awx_zipline_ai.egg-info/requires.txt +42 -0
- awx_zipline_ai-0.3.4/src/awx_zipline_ai.egg-info/top_level.txt +4 -0
- awx_zipline_ai-0.3.4/src/gen_thrift/__init__.py +0 -0
- awx_zipline_ai-0.3.4/src/gen_thrift/api/__init__.py +1 -0
- awx_zipline_ai-0.3.4/src/gen_thrift/api/constants.py +15 -0
- awx_zipline_ai-0.3.4/src/gen_thrift/api/ttypes.py +3754 -0
- awx_zipline_ai-0.3.4/src/gen_thrift/common/__init__.py +1 -0
- awx_zipline_ai-0.3.4/src/gen_thrift/common/constants.py +15 -0
- awx_zipline_ai-0.3.4/src/gen_thrift/common/ttypes.py +1814 -0
- awx_zipline_ai-0.3.4/src/gen_thrift/eval/__init__.py +1 -0
- awx_zipline_ai-0.3.4/src/gen_thrift/eval/constants.py +15 -0
- awx_zipline_ai-0.3.4/src/gen_thrift/eval/ttypes.py +660 -0
- awx_zipline_ai-0.3.4/src/gen_thrift/fetcher/__init__.py +1 -0
- awx_zipline_ai-0.3.4/src/gen_thrift/fetcher/constants.py +15 -0
- awx_zipline_ai-0.3.4/src/gen_thrift/fetcher/ttypes.py +127 -0
- awx_zipline_ai-0.3.4/src/gen_thrift/hub/__init__.py +1 -0
- awx_zipline_ai-0.3.4/src/gen_thrift/hub/constants.py +15 -0
- awx_zipline_ai-0.3.4/src/gen_thrift/hub/ttypes.py +1109 -0
- awx_zipline_ai-0.3.4/src/gen_thrift/observability/__init__.py +1 -0
- awx_zipline_ai-0.3.4/src/gen_thrift/observability/constants.py +15 -0
- awx_zipline_ai-0.3.4/src/gen_thrift/observability/ttypes.py +2355 -0
- awx_zipline_ai-0.3.4/src/gen_thrift/planner/__init__.py +1 -0
- awx_zipline_ai-0.3.4/src/gen_thrift/planner/constants.py +15 -0
- awx_zipline_ai-0.3.4/src/gen_thrift/planner/ttypes.py +1967 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: awx-zipline-ai
|
|
3
|
+
Version: 0.3.4
|
|
4
|
+
Summary: CLI tool for the Zipline AI platform
|
|
5
|
+
Author-email: Zipline AI <hello@zipline.ai>
|
|
6
|
+
License: Apache License 2.0
|
|
7
|
+
Project-URL: homepage, https://zipline.ai
|
|
8
|
+
Project-URL: documentation, https://docs.zipline.ai
|
|
9
|
+
Project-URL: github, https://github.com/zipline-ai/chronon/
|
|
10
|
+
Requires-Python: >=3.11
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Requires-Dist: boto3==1.40.26
|
|
13
|
+
Requires-Dist: botocore==1.40.26
|
|
14
|
+
Requires-Dist: cachetools==5.5.2
|
|
15
|
+
Requires-Dist: certifi==2025.8.3
|
|
16
|
+
Requires-Dist: charset-normalizer==3.4.3
|
|
17
|
+
Requires-Dist: click==8.2.1
|
|
18
|
+
Requires-Dist: crcmod==1.7
|
|
19
|
+
Requires-Dist: gitdb==4.0.12
|
|
20
|
+
Requires-Dist: gitpython==3.1.45
|
|
21
|
+
Requires-Dist: google-api-core[grpc]==2.25.1
|
|
22
|
+
Requires-Dist: google-auth==2.40.3
|
|
23
|
+
Requires-Dist: google-cloud-bigquery-storage==2.33.0
|
|
24
|
+
Requires-Dist: google-cloud-core==2.4.3
|
|
25
|
+
Requires-Dist: google-cloud-iam==2.19.1
|
|
26
|
+
Requires-Dist: google-cloud-storage==2.19.0
|
|
27
|
+
Requires-Dist: google-crc32c==1.7.1
|
|
28
|
+
Requires-Dist: google-resumable-media==2.7.2
|
|
29
|
+
Requires-Dist: googleapis-common-protos[grpc]==1.70.0
|
|
30
|
+
Requires-Dist: grpc-google-iam-v1==0.14.2
|
|
31
|
+
Requires-Dist: grpcio==1.74.0
|
|
32
|
+
Requires-Dist: grpcio-status==1.74.0
|
|
33
|
+
Requires-Dist: idna==3.10
|
|
34
|
+
Requires-Dist: importlib-resources==6.5.2
|
|
35
|
+
Requires-Dist: jmespath==1.0.1
|
|
36
|
+
Requires-Dist: markdown-it-py==4.0.0
|
|
37
|
+
Requires-Dist: mdurl==0.1.2
|
|
38
|
+
Requires-Dist: proto-plus==1.26.1
|
|
39
|
+
Requires-Dist: protobuf==6.32.0
|
|
40
|
+
Requires-Dist: py4j==0.10.9.7
|
|
41
|
+
Requires-Dist: pyasn1==0.6.1
|
|
42
|
+
Requires-Dist: pyasn1-modules==0.4.2
|
|
43
|
+
Requires-Dist: pygments==2.19.2
|
|
44
|
+
Requires-Dist: pyspark==3.5.4
|
|
45
|
+
Requires-Dist: python-dateutil==2.9.0.post0
|
|
46
|
+
Requires-Dist: requests==2.32.5
|
|
47
|
+
Requires-Dist: rich==14.1.0
|
|
48
|
+
Requires-Dist: rsa==4.9.1
|
|
49
|
+
Requires-Dist: s3transfer==0.13.1
|
|
50
|
+
Requires-Dist: six==1.17.0
|
|
51
|
+
Requires-Dist: smmap==5.0.2
|
|
52
|
+
Requires-Dist: thrift==0.21.0
|
|
53
|
+
Requires-Dist: urllib3==2.5.0
|
|
54
|
+
|
|
55
|
+
### Chronon Python API
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
#### Overview
|
|
59
|
+
|
|
60
|
+
Chronon Python API for materializing configs to be run by the Chronon Engine. Contains python helpers to help managed a repo of feature and join definitions to be executed by the chronon scala engine.
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
#### User API Overview
|
|
64
|
+
|
|
65
|
+
##### Sources
|
|
66
|
+
|
|
67
|
+
Most fields are self explanatory. Time columns are expected to be in milliseconds (unixtime).
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
# File <repo>/sources/test_sources.py
|
|
71
|
+
from ai.chronon.query import (
|
|
72
|
+
Query,
|
|
73
|
+
select,
|
|
74
|
+
)
|
|
75
|
+
from ai.chronon.api.ttypes import Source, EventSource, EntitySource
|
|
76
|
+
|
|
77
|
+
# Sample query
|
|
78
|
+
Query(
|
|
79
|
+
selects=select(
|
|
80
|
+
user="user_id",
|
|
81
|
+
created_at="created_at",
|
|
82
|
+
),
|
|
83
|
+
wheres=["has_availability = 1"],
|
|
84
|
+
start_partition="2021-01-01", # Defines the beginning of time for computations related to the source.
|
|
85
|
+
setups=["...UDF..."],
|
|
86
|
+
time_column="ts",
|
|
87
|
+
end_partition=None,
|
|
88
|
+
mutation_time_column="mutation_timestamp",
|
|
89
|
+
reversal_column="CASE WHEN mutation_type IN ('DELETE', 'UPDATE_BEFORE') THEN true ELSE false END"
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
user_activity = Source(entities=EntitySource(
|
|
93
|
+
snapshotTable="db_exports.table",
|
|
94
|
+
mutationTable="mutations_namespace.table_mutations",
|
|
95
|
+
mutationTopic="mutationsKafkaTopic",
|
|
96
|
+
query=Query(...)
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
website__views = Source(events=EventSource(
|
|
100
|
+
table="namespace.table",
|
|
101
|
+
topic="kafkaTopicForEvents",
|
|
102
|
+
)
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
##### Group By (Features)
|
|
107
|
+
|
|
108
|
+
Group Bys are aggregations over sources that define features. For example:
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
# File <repo>/group_bys/example_team/example_group_by.py
|
|
112
|
+
from ai.chronon.group_by import (
|
|
113
|
+
GroupBy,
|
|
114
|
+
Window,
|
|
115
|
+
TimeUnit,
|
|
116
|
+
Accuracy,
|
|
117
|
+
Operation,
|
|
118
|
+
Aggregations,
|
|
119
|
+
Aggregation,
|
|
120
|
+
DefaultAggregation,
|
|
121
|
+
)
|
|
122
|
+
from sources import test_sources
|
|
123
|
+
|
|
124
|
+
sum_cols = [f"active_{x}_days" for x in [30, 90, 120]]
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
v0 = GroupBy(
|
|
128
|
+
sources=test_source.user_activity,
|
|
129
|
+
keys=["user"],
|
|
130
|
+
aggregations=Aggregations(
|
|
131
|
+
user_active_1_day=Aggregation(operation=Operation.LAST),
|
|
132
|
+
second_feature=Aggregation(
|
|
133
|
+
input_column="active_7_days",
|
|
134
|
+
operation=Operation.SUM,
|
|
135
|
+
windows=[
|
|
136
|
+
Window(n, TimeUnit.DAYS) for n in [3, 5, 9]
|
|
137
|
+
]
|
|
138
|
+
),
|
|
139
|
+
) + [
|
|
140
|
+
Aggregation(
|
|
141
|
+
input_column=col,
|
|
142
|
+
operation=Operation.SUM
|
|
143
|
+
) for col in sum_columns # Alternative syntax for defining aggregations.
|
|
144
|
+
] + [
|
|
145
|
+
Aggregation(
|
|
146
|
+
input_column="device",
|
|
147
|
+
operation=LAST_K(10)
|
|
148
|
+
)
|
|
149
|
+
],
|
|
150
|
+
dependencies=[
|
|
151
|
+
"db_exports.table/ds={{ ds }}" # If not defined will be derived from the Source info.
|
|
152
|
+
],
|
|
153
|
+
accuracy=Accuracy.SNAPSHOT, # This could be TEMPORAL for point in time correctness.
|
|
154
|
+
env={
|
|
155
|
+
"backfill": { # Execution environment variables for each of the modes for `run.py`
|
|
156
|
+
"EXECUTOR_MEMORY": "4G"
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
online=True, # True if this group by needs to be uploaded to a KV Store.
|
|
160
|
+
production=False # True if this group by is production level.
|
|
161
|
+
)
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
##### Join
|
|
165
|
+
|
|
166
|
+
A Join is a collection of feature values for the keys and (times if applicable) defined on the left (source). Example:
|
|
167
|
+
|
|
168
|
+
```python
|
|
169
|
+
# File <repo>/joins/example_team/example_join.py
|
|
170
|
+
from ai.chronon.join import Join, JoinPart
|
|
171
|
+
from sources import test_sources
|
|
172
|
+
from group_bys.example_team import example_group_by
|
|
173
|
+
|
|
174
|
+
v1 = Join(
|
|
175
|
+
left=test_sources.website__views,
|
|
176
|
+
right_parts=[
|
|
177
|
+
JoinPart(group_by=example_group_by.v0),
|
|
178
|
+
],
|
|
179
|
+
online=True, # True if this join will be fetched in production.
|
|
180
|
+
production=False, # True if this join should not use non-production group bys.
|
|
181
|
+
env={"backfill": {"PARALLELISM": "10"}, "streaming": {"STREAMING_ENV_VAR": "VALUE"}},
|
|
182
|
+
)
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
##### Pre-commit Setup
|
|
186
|
+
|
|
187
|
+
1. Install pre-commit and other dev libraries:
|
|
188
|
+
```
|
|
189
|
+
pip install -r requirements/dev.txt
|
|
190
|
+
```
|
|
191
|
+
2. Run the following command under `api/python` to install the git hook scripts:
|
|
192
|
+
```
|
|
193
|
+
pre-commit install
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
To support more pre-commit hooks, add them to the `.pre-commit-config.yaml` file.
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
### Chronon Python API
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
#### Overview
|
|
5
|
+
|
|
6
|
+
Chronon Python API for materializing configs to be run by the Chronon Engine. Contains python helpers to help managed a repo of feature and join definitions to be executed by the chronon scala engine.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
#### User API Overview
|
|
10
|
+
|
|
11
|
+
##### Sources
|
|
12
|
+
|
|
13
|
+
Most fields are self explanatory. Time columns are expected to be in milliseconds (unixtime).
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
# File <repo>/sources/test_sources.py
|
|
17
|
+
from ai.chronon.query import (
|
|
18
|
+
Query,
|
|
19
|
+
select,
|
|
20
|
+
)
|
|
21
|
+
from ai.chronon.api.ttypes import Source, EventSource, EntitySource
|
|
22
|
+
|
|
23
|
+
# Sample query
|
|
24
|
+
Query(
|
|
25
|
+
selects=select(
|
|
26
|
+
user="user_id",
|
|
27
|
+
created_at="created_at",
|
|
28
|
+
),
|
|
29
|
+
wheres=["has_availability = 1"],
|
|
30
|
+
start_partition="2021-01-01", # Defines the beginning of time for computations related to the source.
|
|
31
|
+
setups=["...UDF..."],
|
|
32
|
+
time_column="ts",
|
|
33
|
+
end_partition=None,
|
|
34
|
+
mutation_time_column="mutation_timestamp",
|
|
35
|
+
reversal_column="CASE WHEN mutation_type IN ('DELETE', 'UPDATE_BEFORE') THEN true ELSE false END"
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
user_activity = Source(entities=EntitySource(
|
|
39
|
+
snapshotTable="db_exports.table",
|
|
40
|
+
mutationTable="mutations_namespace.table_mutations",
|
|
41
|
+
mutationTopic="mutationsKafkaTopic",
|
|
42
|
+
query=Query(...)
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
website__views = Source(events=EventSource(
|
|
46
|
+
table="namespace.table",
|
|
47
|
+
topic="kafkaTopicForEvents",
|
|
48
|
+
)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
##### Group By (Features)
|
|
53
|
+
|
|
54
|
+
Group Bys are aggregations over sources that define features. For example:
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
# File <repo>/group_bys/example_team/example_group_by.py
|
|
58
|
+
from ai.chronon.group_by import (
|
|
59
|
+
GroupBy,
|
|
60
|
+
Window,
|
|
61
|
+
TimeUnit,
|
|
62
|
+
Accuracy,
|
|
63
|
+
Operation,
|
|
64
|
+
Aggregations,
|
|
65
|
+
Aggregation,
|
|
66
|
+
DefaultAggregation,
|
|
67
|
+
)
|
|
68
|
+
from sources import test_sources
|
|
69
|
+
|
|
70
|
+
sum_cols = [f"active_{x}_days" for x in [30, 90, 120]]
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
v0 = GroupBy(
|
|
74
|
+
sources=test_source.user_activity,
|
|
75
|
+
keys=["user"],
|
|
76
|
+
aggregations=Aggregations(
|
|
77
|
+
user_active_1_day=Aggregation(operation=Operation.LAST),
|
|
78
|
+
second_feature=Aggregation(
|
|
79
|
+
input_column="active_7_days",
|
|
80
|
+
operation=Operation.SUM,
|
|
81
|
+
windows=[
|
|
82
|
+
Window(n, TimeUnit.DAYS) for n in [3, 5, 9]
|
|
83
|
+
]
|
|
84
|
+
),
|
|
85
|
+
) + [
|
|
86
|
+
Aggregation(
|
|
87
|
+
input_column=col,
|
|
88
|
+
operation=Operation.SUM
|
|
89
|
+
) for col in sum_columns # Alternative syntax for defining aggregations.
|
|
90
|
+
] + [
|
|
91
|
+
Aggregation(
|
|
92
|
+
input_column="device",
|
|
93
|
+
operation=LAST_K(10)
|
|
94
|
+
)
|
|
95
|
+
],
|
|
96
|
+
dependencies=[
|
|
97
|
+
"db_exports.table/ds={{ ds }}" # If not defined will be derived from the Source info.
|
|
98
|
+
],
|
|
99
|
+
accuracy=Accuracy.SNAPSHOT, # This could be TEMPORAL for point in time correctness.
|
|
100
|
+
env={
|
|
101
|
+
"backfill": { # Execution environment variables for each of the modes for `run.py`
|
|
102
|
+
"EXECUTOR_MEMORY": "4G"
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
online=True, # True if this group by needs to be uploaded to a KV Store.
|
|
106
|
+
production=False # True if this group by is production level.
|
|
107
|
+
)
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
##### Join
|
|
111
|
+
|
|
112
|
+
A Join is a collection of feature values for the keys and (times if applicable) defined on the left (source). Example:
|
|
113
|
+
|
|
114
|
+
```python
|
|
115
|
+
# File <repo>/joins/example_team/example_join.py
|
|
116
|
+
from ai.chronon.join import Join, JoinPart
|
|
117
|
+
from sources import test_sources
|
|
118
|
+
from group_bys.example_team import example_group_by
|
|
119
|
+
|
|
120
|
+
v1 = Join(
|
|
121
|
+
left=test_sources.website__views,
|
|
122
|
+
right_parts=[
|
|
123
|
+
JoinPart(group_by=example_group_by.v0),
|
|
124
|
+
],
|
|
125
|
+
online=True, # True if this join will be fetched in production.
|
|
126
|
+
production=False, # True if this join should not use non-production group bys.
|
|
127
|
+
env={"backfill": {"PARALLELISM": "10"}, "streaming": {"STREAMING_ENV_VAR": "VALUE"}},
|
|
128
|
+
)
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
##### Pre-commit Setup
|
|
132
|
+
|
|
133
|
+
1. Install pre-commit and other dev libraries:
|
|
134
|
+
```
|
|
135
|
+
pip install -r requirements/dev.txt
|
|
136
|
+
```
|
|
137
|
+
2. Run the following command under `api/python` to install the git hook scripts:
|
|
138
|
+
```
|
|
139
|
+
pre-commit install
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
To support more pre-commit hooks, add them to the `.pre-commit-config.yaml` file.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name="awx-zipline-ai"
|
|
3
|
+
version="0.3.4"
|
|
4
|
+
description="CLI tool for the Zipline AI platform"
|
|
5
|
+
readme="README.md"
|
|
6
|
+
dependencies=["boto3==1.40.26", "botocore==1.40.26", "cachetools==5.5.2", "certifi==2025.8.3", "charset-normalizer==3.4.3", "click==8.2.1", "crcmod==1.7", "gitdb==4.0.12", "gitpython==3.1.45", "google-api-core[grpc]==2.25.1", "google-auth==2.40.3", "google-cloud-bigquery-storage==2.33.0", "google-cloud-core==2.4.3", "google-cloud-iam==2.19.1", "google-cloud-storage==2.19.0", "google-crc32c==1.7.1", "google-resumable-media==2.7.2", "googleapis-common-protos[grpc]==1.70.0", "grpc-google-iam-v1==0.14.2", "grpcio==1.74.0", "grpcio-status==1.74.0", "idna==3.10", "importlib-resources==6.5.2", "jmespath==1.0.1", "markdown-it-py==4.0.0", "mdurl==0.1.2", "proto-plus==1.26.1", "protobuf==6.32.0", "py4j==0.10.9.7", "pyasn1==0.6.1", "pyasn1-modules==0.4.2", "pygments==2.19.2", "pyspark==3.5.4", "python-dateutil==2.9.0.post0", "requests==2.32.5", "rich==14.1.0", "rsa==4.9.1", "s3transfer==0.13.1", "six==1.17.0", "smmap==5.0.2", "thrift==0.21.0", "urllib3==2.5.0"]
|
|
7
|
+
requires-python=">= 3.11"
|
|
8
|
+
license={text="Apache License 2.0"}
|
|
9
|
+
keywords=[]
|
|
10
|
+
classifiers=[]
|
|
11
|
+
authors=[{name="Zipline AI", email="hello@zipline.ai"}]
|
|
12
|
+
|
|
13
|
+
[project.urls]
|
|
14
|
+
"homepage"="https://zipline.ai"
|
|
15
|
+
"documentation"="https://docs.zipline.ai"
|
|
16
|
+
"github"="https://github.com/zipline-ai/chronon/"
|
|
17
|
+
|
|
18
|
+
[build-system]
|
|
19
|
+
requires=["setuptools"]
|
|
20
|
+
build-backend="setuptools.build_meta"
|
|
21
|
+
|
|
22
|
+
[project.scripts]
|
|
23
|
+
zipline = "ai.chronon.repo.zipline:zipline"
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__all__ = ['ttypes', 'constants']
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Autogenerated by Thrift Compiler (0.22.0)
|
|
3
|
+
#
|
|
4
|
+
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
5
|
+
#
|
|
6
|
+
# options string: py
|
|
7
|
+
#
|
|
8
|
+
|
|
9
|
+
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
|
|
10
|
+
from thrift.protocol.TProtocol import TProtocolException
|
|
11
|
+
from thrift.TRecursive import fix_spec
|
|
12
|
+
from uuid import UUID
|
|
13
|
+
|
|
14
|
+
import sys
|
|
15
|
+
from .ttypes import *
|