airbyte_cdk.sources.streams.concurrent.partitions.partition_generator

 1#
 2# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
 3#
 4
 5from abc import ABC, abstractmethod
 6from typing import Iterable
 7
 8from airbyte_cdk.sources.streams.concurrent.partitions.partition import Partition
 9
10
11class PartitionGenerator(ABC):
12    @abstractmethod
13    def generate(self) -> Iterable[Partition]:
14        """
15        Generates partitions for a given sync mode.
16        :return: An iterable of partitions
17        """
18        pass
class PartitionGenerator(abc.ABC):
12class PartitionGenerator(ABC):
13    @abstractmethod
14    def generate(self) -> Iterable[Partition]:
15        """
16        Generates partitions for a given sync mode.
17        :return: An iterable of partitions
18        """
19        pass

Helper class that provides a standard way to create an ABC using inheritance.

@abstractmethod
def generate( self) -> Iterable[airbyte_cdk.sources.streams.concurrent.partitions.partition.Partition]:
13    @abstractmethod
14    def generate(self) -> Iterable[Partition]:
15        """
16        Generates partitions for a given sync mode.
17        :return: An iterable of partitions
18        """
19        pass

Generates partitions for a given sync mode.

Returns

An iterable of partitions