Skip to content

Commit

Permalink
🚧 refactored: add method on services file that will implement.
Browse files Browse the repository at this point in the history
  • Loading branch information
korawica committed May 6, 2024
1 parent 6f14fcc commit 44d62a3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
14 changes: 14 additions & 0 deletions app/core/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ def backup(self): ...

def retention(self): ...

def init(self): ...


class NodeIngest(BaseNode):
"""Node for Ingestion"""
Expand All @@ -148,6 +150,18 @@ def push(self):
class Pipeline(PipelineCatalog):
"""Pipeline Service Model"""

def nodes(self): ...

def log_push(self): ...

def log_fetch(self): ...

def check_triggered(self): ...

def check_scheduled(self): ...

def schedule_push(self): ...


class Task(BaseTask):
"""Task Service Model"""
Expand Down
16 changes: 11 additions & 5 deletions app/core/statements.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ def statement_check(self) -> str:
)

def statement_create(
self, bk: bool = False, bk_name: Optional[str] = None
self,
bk: bool = False,
bk_name: Optional[str] = None,
) -> str:
"""Generate create statement
Expand All @@ -182,17 +184,21 @@ def statement_create(
)
return (
re.sub(
r"{database_name}\.{ai_schema_name}\.\w+",
f"{{database_name}}.{{ai_schema_name_backup}}."
f"{bk_name or f'{self.name}_bk'}",
r"{{database_name}\.{ai_schema_name}\.\w+",
(
f"{{database_name}}.{{ai_schema_name_backup}}."
f"{bk_name or f'{self.name}_bk'}"
),
create_stm,
)
if bk
else create_stm
)

def statement_create_partition(
self, start: str, end: Optional[str] = None
self,
start: str,
end: Optional[str] = None,
) -> str:
"""Generate create partition statement
Expand Down

0 comments on commit 44d62a3

Please sign in to comment.