from laplace_spark._typing import Transformation
from laplace_spark.modules.provider import Provider  # type: ignore
from laplace_spark.utils.etl_step import ETLStep


class TransformationFactory:
    def provider(self, provider: Provider) -> "TransformationFactory":
        if provider is Provider.SMARTSTORE:
            from laplace_spark.transformation_factory.smartstore import (
                TransformationFactorySmartstore,
            )

            return TransformationFactorySmartstore()
        else:
            return self

    def etl_step(self, etl_step: ETLStep) -> "TransformationFactory":
        if etl_step is ETLStep.SOURCING:
            from laplace_spark.transformation_factory.tmp_to_src import (
                TransformationFactoryTmpToSrc,
            )

            return TransformationFactoryTmpToSrc()
        elif etl_step is ETLStep.LOG_0:
            from laplace_spark.transformation_factory.src_to_log0 import (
                TransformationFactorySrcToLog0,
            )

            return TransformationFactorySrcToLog0()
        else:
            return self

    def build(self) -> Transformation:
        raise NotImplementedError()

from laplace_spark._typing import Transformation
from laplace_spark.modules.provider import Provider  # type: ignore
from laplace_spark.utils.etl_step import ETLStep


class TransformationFactory:
    def provider(self, provider: Provider) -> "TransformationFactory":
        if provider is Provider.SMARTSTORE:
            from laplace_spark.transformation_factory.smartstore import (
                TransformationFactorySmartstore,
            )

            return TransformationFactorySmartstore()
        else:
            return self

    def etl_step(self, etl_step: ETLStep) -> "TransformationFactory":
        if etl_step is ETLStep.SOURCING:
            from laplace_spark.transformation_factory.tmp_to_src import (
                TransformationFactoryTmpToSrc,
            )

            return TransformationFactoryTmpToSrc()
        elif etl_step is ETLStep.LOG_0:
            from laplace_spark.transformation_factory.src_to_log0 import (
                TransformationFactorySrcToLog0,
            )

            return TransformationFactorySrcToLog0()
        else:
            return self

    def build(self) -> Transformation:
        raise NotImplementedError()

# type: ignore