Skip to content

Commit

Permalink
[feat] generate dags from yaml file
Browse files Browse the repository at this point in the history
  • Loading branch information
tuancamtbtx committed Jul 2, 2024
1 parent 98bc14e commit 1c0f8dd
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 0 deletions.
6 changes: 6 additions & 0 deletions airlake/console/git_sync.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

def main():
pass

if __name__ == '__main__':
main()
2 changes: 2 additions & 0 deletions airlake/factory/compiler.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class DagCompiler:
pass
44 changes: 44 additions & 0 deletions airlake/factory/enity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
from dataclasses import dataclass, field
from typing import Dict, Any, Optional, List
import dacite

class RepoType:
Python = "python"
Yaml = "yaml"

@dataclass
class TeamConnection:
conn_id: str
replace_fields: List[str]
@staticmethod
def from_list(items: List[Dict[str, Any]]):
return [dacite.from_dict(data_class=TeamConnection, data=i) for i in items]

@dataclass
class Alerting:
kind: str
conn_id: str

@staticmethod
def from_dict(conf):
return dacite.from_dict(data_class=Alerting, data=conf)


@dataclass
class TeamConfig:
name: str
prefix: str
owner: str
repo_id: Optional[str]
role_id: Optional[int]
alert: Optional[Alerting]
conns: Optional[List[TeamConnection]]
team_dir: Optional[str]
pool: Optional[str]
type: Optional[str] = "yaml"

def is_yaml(self):
return not self.type or self.type == RepoType.Yaml

def is_python(self):
return self.type == RepoType.Python
Empty file added airlake/factory/model.py
Empty file.
2 changes: 2 additions & 0 deletions airlake/manager/backfill_web.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Backfill:
pass

0 comments on commit 1c0f8dd

Please sign in to comment.