def METHOD_NAME(self, dataset: Dataset) -> None:
    """
    The preprocess function iterates over the dataset to gather data that
    is necessary for grouping.
    This includes:
        1) Storing first/last timestamp in the dataset
        2) Aligning time series
        3) Calculating groups
    """
    for data in dataset:
        timestamp = data["start"]
        self.first_timestamp = min(self.first_timestamp, timestamp)
        self.frequency = (
            timestamp.freq if self.frequency is None else self.frequency
        )
        self.last_timestamp = max(
            self.last_timestamp,
            timestamp + len(data["target"]) * self.frequency,
        )
        # todo
        self.max_target_length = max(
            self.max_target_length, len(data["target"])
        )
    logging.info(
        f"first/last timestamp found: {self.first_timestamp}/{self.last_timestamp}"
    )