-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
58 lines (54 loc) · 1.62 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
import getpass
import subprocess
from sqlmesh.core.config import (
Config,
ModelDefaultsConfig,
GatewayConfig,
DuckDBConnectionConfig,
NameInferenceConfig,
CategorizerConfig,
PlanConfig,
AutoCategorizationMode
)
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="arcane-insight",
default_target_environment=default_environment,
gateways={
"local": GatewayConfig(
connection=DuckDBConnectionConfig(
catalogs={
"bronze": "./data/bronze.duckdb",
"silver": "./data/silver.duckdb",
"gold": "./data/gold.duckdb"
}
)
)
},
default_gateway="local",
model_defaults=ModelDefaultsConfig(
dialect="duckdb",
start="2024-11-01"
),
model_naming=NameInferenceConfig(
infer_names=True
),
plan=PlanConfig(
auto_categorize_changes=CategorizerConfig(
external=AutoCategorizationMode.FULL,
python=AutoCategorizationMode.FULL,
sql=AutoCategorizationMode.FULL,
seed=AutoCategorizationMode.FULL
)
)
)