-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
62 lines (56 loc) · 1.67 KB
/
config.py
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import getpass
import subprocess
from dotenv import load_dotenv
from sqlmesh.core.config import (
Config,
ModelDefaultsConfig,
GatewayConfig,
DuckDBConnectionConfig,
NameInferenceConfig,
CategorizerConfig,
PlanConfig,
AutoCategorizationMode
)
load_dotenv()
def get_current_branch():
try:
branch_name = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']).strip().decode('utf-8')
return branch_name
except Exception as e:
print(f"Error getting current branch: {e}")
return None
current_user = getpass.getuser()
branch = get_current_branch() or 'dev'
default_environment = f"{current_user}__{branch}".replace('-', '_')
print(f"Environment is set to: {default_environment}.")
config = Config(
project="obisidan-insights",
default_target_environment=default_environment,
gateways={
"duckdb": GatewayConfig(
connection=DuckDBConnectionConfig(
database="tpch.duckdb",
connector_config={
"memory_limit":"100GB"
}
)
),
},
default_gateway="duckdb",
model_defaults=ModelDefaultsConfig(
dialect="duckdb,normalization_strategy=case_sensitive",
start="2025-01-01",
cron="*/5 * * * *"
),
model_naming=NameInferenceConfig(
infer_names=True
),
plan=PlanConfig(
auto_categorize_changes=CategorizerConfig(
external=AutoCategorizationMode.FULL,
python=AutoCategorizationMode.FULL,
sql=AutoCategorizationMode.FULL,
seed=AutoCategorizationMode.FULL
)
)
)