"""Transform Abstract Class."""

from abc import ABC, abstractmethod
from typing import Any, List

from pyspark.sql import DataFrame


class TransformComponent(ABC):
    """Defines an abstract class for Transform entities.

    Attributes:
        parent: parent transform component.
    """

    def __init__(self) -> None:
        self._parent = None

    @property
    def parent(self) -> Any:
        """Parent transform component."""
        return self._parent

    @parent.setter
    def parent(self, parent: None) -> None:
        self._parent = parent

    @property
    @abstractmethod
    def output_columns(self) -> List[str]:
        """Columns generated by the transformation."""

    @abstractmethod
    def transform(self, dataframe: DataFrame) -> DataFrame:
        """Performs a transformation to the feature pipeline.

        Args:
            dataframe: input dataframe.

        Returns:
            Transformed dataframe.
        """
