-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0164504
commit dd7f999
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ classifiers = [ | |
"Typing :: Typed" | ||
] | ||
dependencies = [ | ||
"attrs~=23.2.0", | ||
"typing-extensions>=4.10.0", | ||
"sghi-commons @ git+https://github.com/savannahghi/[email protected]", | ||
"sghi-etl-core @ git+https://github.com/savannahghi/[email protected]", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from __future__ import annotations | ||
|
||
from typing import TYPE_CHECKING, Generic, TypeVar | ||
|
||
from attrs import define | ||
|
||
if TYPE_CHECKING: | ||
from sghi.etl.core import Processor, Sink, Source, WorkflowDefinition | ||
|
||
# ============================================================================= | ||
# TYPES | ||
# ============================================================================= | ||
|
||
|
||
_PDT = TypeVar("_PDT") | ||
"""Processed Data Type.""" | ||
|
||
_RDT = TypeVar("_RDT") | ||
"""Raw Data Type.""" | ||
|
||
|
||
# ============================================================================= | ||
# WORKFLOW BUILDER | ||
# ============================================================================= | ||
|
||
|
||
@define | ||
class WorkflowBuilder(Generic[_RDT, _PDT]): | ||
|
||
def __call__(self) -> WorkflowDefinition[_RDT, _PDT]: | ||
return self.build() | ||
|
||
def build(self) -> WorkflowDefinition[_RDT, _PDT]: ... | ||
|
||
def draw_from(self, source: Source[_RDT]) -> Source[_RDT]: ... | ||
|
||
def drain_to(self, sink: Sink[_PDT]) -> Sink[_PDT]: ... | ||
|
||
def process_using( | ||
self, | ||
processor: Processor[_RDT, _PDT], | ||
) -> Processor[_RDT, _PDT]: ... |