Skip to content

Reader

Defines abstract reader behaviour.

Reader

Bases: ABC

Abstract Reader class.

Source code in mkdocs/lakehouse_engine/packages/io/reader.py
class Reader(ABC):
    """Abstract Reader class."""

    def __init__(self, input_spec: InputSpec):
        """Construct Reader instances.

        Args:
            input_spec: input specification for reading data.
        """
        self._logger = LoggingHandler(self.__class__.__name__).get_logger()
        self._input_spec = input_spec

    @abstractmethod
    def read(self) -> DataFrame:
        """Abstract read method.

        Returns:
            A dataframe read according to the input specification.
        """
        raise NotImplementedError

__init__(input_spec)

Construct Reader instances.

Parameters:

Name Type Description Default
input_spec InputSpec

input specification for reading data.

required
Source code in mkdocs/lakehouse_engine/packages/io/reader.py
def __init__(self, input_spec: InputSpec):
    """Construct Reader instances.

    Args:
        input_spec: input specification for reading data.
    """
    self._logger = LoggingHandler(self.__class__.__name__).get_logger()
    self._input_spec = input_spec

read() abstractmethod

Abstract read method.

Returns:

Type Description
DataFrame

A dataframe read according to the input specification.

Source code in mkdocs/lakehouse_engine/packages/io/reader.py
@abstractmethod
def read(self) -> DataFrame:
    """Abstract read method.

    Returns:
        A dataframe read according to the input specification.
    """
    raise NotImplementedError