Skip to content
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api/py/ai/chronon/cli/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ def green(text):

def require(cond, message):
if not cond:
print(f"{red("❌")} {message}")
print(f"X: {message}")
sys.exit(1)


def done(cond, message):
print(f"{green("✅")} {message}")
print(f"DONE: {message}")
4 changes: 0 additions & 4 deletions api/py/ai/chronon/repo/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,3 @@ def _print_error(left, right):
def _print_warning(string):
# print in yellow - \u001b[33m
print(f"\u001b[33m{string}\u001b[0m")


if __name__ == "__main__":
extract_and_convert()
25 changes: 23 additions & 2 deletions api/py/ai/chronon/repo/zipline.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import os
import click

from ai.chronon.repo.compile import extract_and_convert
from ai.chronon.cli.compile.compile_context import CompileContext
from ai.chronon.cli.compile.compiler import Compiler
from ai.chronon.repo.run import main as run_main
from ai.chronon.repo.init import main as init_main

Expand All @@ -10,6 +12,25 @@ def zipline():
pass


zipline.add_command(extract_and_convert)
@click.command(name="compile")
def compile():
# check that a "teams.py" file exists in the current directory
if not (os.path.exists("teams.py") or os.path.exists("teams.json")):
raise click.ClickException(
(
"teams.py or teams.json file not found in current directory."
" Please run from the top level of conf directory."
)
)

compile_context = CompileContext()
compiler = Compiler(compile_context)
compiler.compile(compile_context)


zipline.add_command(compile)
zipline.add_command(run_main)
zipline.add_command(init_main)

# if __name__ == "__main__":
# compile()
3 changes: 2 additions & 1 deletion api/py/requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ sqlglot
crcmod==1.7
glom
boto3
importlib-resources==6.5.2
importlib-resources==6.5.2
rich
6 changes: 6 additions & 0 deletions api/py/requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ jmespath==1.0.1
# via
# boto3
# botocore
markdown-it-py==3.0.0
# via rich
proto-plus==1.25.0
# via google-api-core
protobuf==5.29.3
Expand All @@ -59,12 +61,16 @@ pyasn1==0.6.1
# rsa
pyasn1-modules==0.4.1
# via google-auth
pygments==2.19.1
# via rich
python-dateutil==2.9.0.post0
# via botocore
requests==2.32.3
# via
# google-api-core
# google-cloud-storage
rich==13.9.4
# via -r requirements/base.in
rsa==4.9
# via google-auth
s3transfer==0.11.4
Expand Down
13 changes: 7 additions & 6 deletions api/py/test/sample/teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@


test = Team(
namespace="test",
outputNamespace="test",
env=EnvironmentVariables(
common={
"GCP_BIGTABLE_INSTANCE_ID": "test-instance" # example, custom bigtable instance
Expand All @@ -63,7 +63,8 @@


sample_team = Team(
namespace="test",
# namespace="test",
outputNamespace="test",
env=EnvironmentVariables(
common={
"GCP_BIGTABLE_INSTANCE_ID": "test-instance" # example, custom bigtable instance
Expand All @@ -82,10 +83,10 @@
),
)

etsy_search = Team(namespace="etsy-search")
etsy_search = Team(outputNamespace="etsy-search")

kaggle = Team(namespace="kaggle")
kaggle = Team(outputNamespace="kaggle")

quickstart = Team(namespace="quickstart")
quickstart = Team(outputNamespace="quickstart")

risk = Team(namespace="risk")
risk = Team(outputNamespace="risk")
Loading