26 lines
794 B
Python
26 lines
794 B
Python
"""Base transform node for data pipeline."""
|
|
from abc import ABC, abstractmethod
|
|
import sqlite3
|
|
|
|
from pipeline import TransformContext
|
|
|
|
class TransformNode(ABC):
|
|
"""Abstract base class for transformation nodes.
|
|
|
|
Each transform node implements a single transformation step
|
|
that takes data from the database, transforms it, and
|
|
potentially writes results back.
|
|
"""
|
|
|
|
@abstractmethod
|
|
def run(self, con: sqlite3.Connection, context: TransformContext) -> TransformContext:
|
|
"""Execute the transformation.
|
|
|
|
Args:
|
|
con: SQLite database connection
|
|
context: TransformContext containing the input dataframe
|
|
|
|
Returns:
|
|
TransformContext with the transformed dataframe
|
|
"""
|
|
pass
|