Skip to content

Commit

Permalink
prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
kennedykori committed Jun 9, 2024
1 parent 0164504 commit dd7f999
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]",
Expand Down
42 changes: 42 additions & 0 deletions src/sghi/etl/commons/workflow_builder.py
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]: ...

0 comments on commit dd7f999

Please sign in to comment.