Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into artem1205/datetime-pa…
Browse files Browse the repository at this point in the history
…rser
  • Loading branch information
artem1205 committed Dec 24, 2024
2 parents d029e61 + 2671c24 commit e4e3ffe
Show file tree
Hide file tree
Showing 35 changed files with 331 additions and 122 deletions.
127 changes: 93 additions & 34 deletions airbyte_cdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,46 @@
# Once those issues are resolved, the below can be sorted with isort.
import dunamai as _dunamai

from .destinations import Destination
from .models import AirbyteConnectionStatus, AirbyteMessage, ConfiguredAirbyteCatalog, Status, Type, FailureType, AirbyteStream, AdvancedAuth, DestinationSyncMode, ConnectorSpecification, OAuthConfigSpecification, OrchestratorType, ConfiguredAirbyteStream, SyncMode, AirbyteLogMessage, Level, AirbyteRecordMessage

from .sources import Source
from .config_observation import create_connector_config_control_message, emit_configuration_as_airbyte_control_message
from .config_observation import (
create_connector_config_control_message,
emit_configuration_as_airbyte_control_message,
)
from .connector import BaseConnector, Connector

from .entrypoint import launch, AirbyteEntrypoint

from .destinations import Destination
from .entrypoint import AirbyteEntrypoint, launch
from .logger import AirbyteLogFormatter, init_logger
from .sources import AbstractSource
from .models import (
AdvancedAuth,
AirbyteConnectionStatus,
AirbyteLogMessage,
AirbyteMessage,
AirbyteRecordMessage,
AirbyteStream,
ConfiguredAirbyteCatalog,
ConfiguredAirbyteStream,
ConnectorSpecification,
DestinationSyncMode,
FailureType,
Level,
OAuthConfigSpecification,
OrchestratorType,
Status,
SyncMode,
Type,
)
from .sources import AbstractSource, Source
from .sources.concurrent_source.concurrent_source import ConcurrentSource
from .sources.concurrent_source.concurrent_source_adapter import ConcurrentSourceAdapter
from .sources.config import BaseConfig
from .sources.types import Config, Record, StreamSlice
from .sources.connector_state_manager import ConnectorStateManager
from .sources.declarative.auth import DeclarativeOauth2Authenticator
from .sources.declarative.auth.declarative_authenticator import DeclarativeAuthenticator
from .sources.declarative.auth.declarative_authenticator import NoAuth
from .sources.declarative.auth.declarative_authenticator import DeclarativeAuthenticator, NoAuth
from .sources.declarative.auth.oauth import DeclarativeSingleUseRefreshTokenOauth2Authenticator
from .sources.declarative.auth.token import BasicHttpAuthenticator, BearerAuthenticator, ApiKeyAuthenticator
from .sources.declarative.auth.token import (
ApiKeyAuthenticator,
BasicHttpAuthenticator,
BearerAuthenticator,
)
from .sources.declarative.datetime.min_max_datetime import MinMaxDatetime
from .sources.declarative.declarative_stream import DeclarativeStream
from .sources.declarative.decoders import Decoder, JsonDecoder
Expand All @@ -77,48 +96,89 @@
from .sources.declarative.extractors.record_extractor import RecordExtractor
from .sources.declarative.extractors.record_filter import RecordFilter
from .sources.declarative.incremental import DatetimeBasedCursor
from .sources.declarative.interpolation import InterpolatedString, InterpolatedBoolean
from .sources.declarative.interpolation import InterpolatedBoolean, InterpolatedString
from .sources.declarative.manifest_declarative_source import ManifestDeclarativeSource
from .sources.declarative.migrations.legacy_to_per_partition_state_migration import LegacyToPerPartitionStateMigration

from .sources.declarative.partition_routers import CartesianProductStreamSlicer, SinglePartitionRouter, SubstreamPartitionRouter
from .sources.declarative.migrations.legacy_to_per_partition_state_migration import (
LegacyToPerPartitionStateMigration,
)
from .sources.declarative.partition_routers import (
CartesianProductStreamSlicer,
SinglePartitionRouter,
SubstreamPartitionRouter,
)
from .sources.declarative.partition_routers.substream_partition_router import ParentStreamConfig
from .sources.declarative.requesters import Requester, HttpRequester

from .sources.declarative.requesters import HttpRequester, Requester
from .sources.declarative.requesters.error_handlers import BackoffStrategy
from .sources.declarative.requesters.paginators import DefaultPaginator, PaginationStrategy
from .sources.declarative.requesters.paginators.strategies import OffsetIncrement, CursorPaginationStrategy, PageIncrement, StopConditionPaginationStrategyDecorator

from .sources.declarative.requesters.paginators.strategies import (
CursorPaginationStrategy,
OffsetIncrement,
PageIncrement,
StopConditionPaginationStrategyDecorator,
)
from .sources.declarative.requesters.request_option import RequestOption, RequestOptionType

from .sources.declarative.requesters.request_options.default_request_options_provider import DefaultRequestOptionsProvider
from .sources.declarative.requesters.request_options.interpolated_request_input_provider import InterpolatedRequestInputProvider
from .sources.declarative.requesters.request_options.default_request_options_provider import (
DefaultRequestOptionsProvider,
)
from .sources.declarative.requesters.request_options.interpolated_request_input_provider import (
InterpolatedRequestInputProvider,
)
from .sources.declarative.requesters.requester import HttpMethod
from .sources.declarative.retrievers import SimpleRetriever
from .sources.declarative.schema import JsonFileSchemaLoader
from .sources.declarative.transformations.add_fields import AddFields, AddedFieldDefinition
from .sources.declarative.transformations.add_fields import AddedFieldDefinition, AddFields
from .sources.declarative.transformations.transformation import RecordTransformation
from .sources.declarative.types import FieldPointer
from .sources.declarative.yaml_declarative_source import YamlDeclarativeSource
from .sources.message import InMemoryMessageRepository, MessageRepository
from .sources.source import TState
from .sources.streams.availability_strategy import AvailabilityStrategy
from .sources.streams.call_rate import AbstractAPIBudget, HttpAPIBudget, HttpRequestMatcher, MovingWindowCallRatePolicy, Rate, CachedLimiterSession, LimiterSession
from .sources.streams.call_rate import (
AbstractAPIBudget,
CachedLimiterSession,
HttpAPIBudget,
HttpRequestMatcher,
LimiterSession,
MovingWindowCallRatePolicy,
Rate,
)
from .sources.streams.checkpoint import Cursor as LegacyCursor
from .sources.streams.checkpoint import ResumableFullRefreshCursor
from .sources.streams.concurrent.adapters import StreamFacade
from .sources.streams.concurrent.cursor import ConcurrentCursor, CursorField, FinalStateCursor
from .sources.streams.concurrent.cursor import Cursor
from .sources.streams.concurrent.state_converters.datetime_stream_state_converter import EpochValueConcurrentStreamStateConverter, IsoMillisConcurrentStreamStateConverter
from .sources.streams.core import Stream, IncrementalMixin, package_name_from_class
from .sources.streams.concurrent.cursor import (
ConcurrentCursor,
Cursor,
CursorField,
FinalStateCursor,
)
from .sources.streams.concurrent.state_converters.datetime_stream_state_converter import (
EpochValueConcurrentStreamStateConverter,
IsoMillisConcurrentStreamStateConverter,
)
from .sources.streams.core import IncrementalMixin, Stream, package_name_from_class
from .sources.streams.http import HttpStream, HttpSubStream
from .sources.streams.http.availability_strategy import HttpAvailabilityStrategy
from .sources.streams.http.exceptions import BaseBackoffException, DefaultBackoffException, UserDefinedBackoffException
from .sources.streams.http.exceptions import (
BaseBackoffException,
DefaultBackoffException,
UserDefinedBackoffException,
)
from .sources.streams.http.rate_limiting import default_backoff_handler
from .sources.streams.http.requests_native_auth import Oauth2Authenticator, TokenAuthenticator, SingleUseRefreshTokenOauth2Authenticator
from .sources.streams.http.requests_native_auth import (
Oauth2Authenticator,
SingleUseRefreshTokenOauth2Authenticator,
TokenAuthenticator,
)
from .sources.streams.http.requests_native_auth.abstract_token import AbstractHeaderAuthenticator
from .sources.types import Config, Record, StreamSlice
from .sources.utils import casing
from .sources.utils.schema_helpers import InternalConfig, ResourceSchemaLoader, check_config_against_spec_or_exit, split_config, expand_refs
from .sources.utils.schema_helpers import (
InternalConfig,
ResourceSchemaLoader,
check_config_against_spec_or_exit,
expand_refs,
split_config,
)
from .sources.utils.transform import TransformConfig, TypeTransformer
from .utils import AirbyteTracedException, is_cloud_environment
from .utils.constants import ENV_REQUEST_CACHE_PATH
Expand All @@ -127,7 +187,6 @@
from .utils.spec_schema_transformations import resolve_refs
from .utils.stream_status_utils import as_airbyte_message


__all__ = [
# Availability strategy
"AvailabilityStrategy",
Expand Down
1 change: 0 additions & 1 deletion airbyte_cdk/cli/source_declarative_manifest/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from airbyte_cdk.cli.source_declarative_manifest._run import run


__all__ = [
"run",
]
21 changes: 10 additions & 11 deletions airbyte_cdk/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# of airbyte-cdk rather than a standalone package.
from .airbyte_protocol import (
AdvancedAuth,
AirbyteStateStats,
AirbyteAnalyticsTraceMessage,
AirbyteCatalog,
AirbyteConnectionStatus,
Expand All @@ -22,13 +21,14 @@
AirbyteRecordMessage,
AirbyteStateBlob,
AirbyteStateMessage,
AirbyteStateStats,
AirbyteStateType,
AirbyteStream,
AirbyteStreamState,
AirbyteStreamStatus,
AirbyteStreamStatusTraceMessage,
AirbyteStreamStatusReason,
AirbyteStreamStatusReasonType,
AirbyteStreamStatusTraceMessage,
AirbyteTraceMessage,
AuthFlowType,
ConfiguredAirbyteCatalog,
Expand All @@ -48,6 +48,14 @@
TraceType,
Type,
)
from .airbyte_protocol_serializers import (
AirbyteMessageSerializer,
AirbyteStateMessageSerializer,
AirbyteStreamStateSerializer,
ConfiguredAirbyteCatalogSerializer,
ConfiguredAirbyteStreamSerializer,
ConnectorSpecificationSerializer,
)
from .well_known_types import (
BinaryData,
Boolean,
Expand All @@ -61,12 +69,3 @@
TimeWithoutTimezone,
TimeWithTimezone,
)

from .airbyte_protocol_serializers import (
AirbyteStreamStateSerializer,
AirbyteStateMessageSerializer,
AirbyteMessageSerializer,
ConfiguredAirbyteCatalogSerializer,
ConfiguredAirbyteStreamSerializer,
ConnectorSpecificationSerializer,
)
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
TypeVar,
)

from airbyte_cdk import StreamSlice
from airbyte_cdk.logger import lazy_log
from airbyte_cdk.models import FailureType
from airbyte_cdk.sources.declarative.async_job.job import AsyncJob
Expand All @@ -31,6 +30,7 @@
from airbyte_cdk.sources.declarative.async_job.repository import AsyncJobRepository
from airbyte_cdk.sources.declarative.async_job.status import AsyncJobStatus
from airbyte_cdk.sources.message import MessageRepository
from airbyte_cdk.sources.types import StreamSlice
from airbyte_cdk.utils.airbyte_secrets_utils import filter_secrets
from airbyte_cdk.utils.traced_exception import AirbyteTracedException

Expand Down
7 changes: 2 additions & 5 deletions airbyte_cdk/sources/declarative/auth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#

from airbyte_cdk.sources.declarative.auth.oauth import DeclarativeOauth2Authenticator
from airbyte_cdk.sources.declarative.auth.jwt import JwtAuthenticator
from airbyte_cdk.sources.declarative.auth.oauth import DeclarativeOauth2Authenticator

__all__ = [
"DeclarativeOauth2Authenticator",
"JwtAuthenticator"
]
__all__ = ["DeclarativeOauth2Authenticator", "JwtAuthenticator"]
22 changes: 19 additions & 3 deletions airbyte_cdk/sources/declarative/decoders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,25 @@
#

from airbyte_cdk.sources.declarative.decoders.decoder import Decoder
from airbyte_cdk.sources.declarative.decoders.json_decoder import JsonDecoder, JsonlDecoder, IterableDecoder, GzipJsonDecoder
from airbyte_cdk.sources.declarative.decoders.json_decoder import (
GzipJsonDecoder,
IterableDecoder,
JsonDecoder,
JsonlDecoder,
)
from airbyte_cdk.sources.declarative.decoders.noop_decoder import NoopDecoder
from airbyte_cdk.sources.declarative.decoders.pagination_decoder_decorator import PaginationDecoderDecorator
from airbyte_cdk.sources.declarative.decoders.pagination_decoder_decorator import (
PaginationDecoderDecorator,
)
from airbyte_cdk.sources.declarative.decoders.xml_decoder import XmlDecoder

__all__ = ["Decoder", "JsonDecoder", "JsonlDecoder", "IterableDecoder", "GzipJsonDecoder", "NoopDecoder", "PaginationDecoderDecorator", "XmlDecoder"]
__all__ = [
"Decoder",
"JsonDecoder",
"JsonlDecoder",
"IterableDecoder",
"GzipJsonDecoder",
"NoopDecoder",
"PaginationDecoderDecorator",
"XmlDecoder",
]
12 changes: 10 additions & 2 deletions airbyte_cdk/sources/declarative/extractors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
from airbyte_cdk.sources.declarative.extractors.http_selector import HttpSelector
from airbyte_cdk.sources.declarative.extractors.record_filter import RecordFilter
from airbyte_cdk.sources.declarative.extractors.record_selector import RecordSelector
from airbyte_cdk.sources.declarative.extractors.response_to_file_extractor import ResponseToFileExtractor
from airbyte_cdk.sources.declarative.extractors.response_to_file_extractor import (
ResponseToFileExtractor,
)

__all__ = ["HttpSelector", "DpathExtractor", "RecordFilter", "RecordSelector", "ResponseToFileExtractor"]
__all__ = [
"HttpSelector",
"DpathExtractor",
"RecordFilter",
"RecordSelector",
"ResponseToFileExtractor",
]
13 changes: 10 additions & 3 deletions airbyte_cdk/sources/declarative/incremental/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@

from airbyte_cdk.sources.declarative.incremental.datetime_based_cursor import DatetimeBasedCursor
from airbyte_cdk.sources.declarative.incremental.declarative_cursor import DeclarativeCursor
from airbyte_cdk.sources.declarative.incremental.global_substream_cursor import GlobalSubstreamCursor
from airbyte_cdk.sources.declarative.incremental.per_partition_cursor import CursorFactory, PerPartitionCursor
from airbyte_cdk.sources.declarative.incremental.per_partition_with_global import PerPartitionWithGlobalCursor
from airbyte_cdk.sources.declarative.incremental.global_substream_cursor import (
GlobalSubstreamCursor,
)
from airbyte_cdk.sources.declarative.incremental.per_partition_cursor import (
CursorFactory,
PerPartitionCursor,
)
from airbyte_cdk.sources.declarative.incremental.per_partition_with_global import (
PerPartitionWithGlobalCursor,
)
from airbyte_cdk.sources.declarative.incremental.resumable_full_refresh_cursor import (
ChildPartitionResumableFullRefreshCursor,
ResumableFullRefreshCursor,
Expand Down
22 changes: 16 additions & 6 deletions airbyte_cdk/sources/declarative/partition_routers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,28 @@
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
#

from airbyte_cdk.sources.declarative.partition_routers.async_job_partition_router import AsyncJobPartitionRouter
from airbyte_cdk.sources.declarative.partition_routers.cartesian_product_stream_slicer import CartesianProductStreamSlicer
from airbyte_cdk.sources.declarative.partition_routers.list_partition_router import ListPartitionRouter
from airbyte_cdk.sources.declarative.partition_routers.single_partition_router import SinglePartitionRouter
from airbyte_cdk.sources.declarative.partition_routers.substream_partition_router import SubstreamPartitionRouter
from airbyte_cdk.sources.declarative.partition_routers.async_job_partition_router import (
AsyncJobPartitionRouter,
)
from airbyte_cdk.sources.declarative.partition_routers.cartesian_product_stream_slicer import (
CartesianProductStreamSlicer,
)
from airbyte_cdk.sources.declarative.partition_routers.list_partition_router import (
ListPartitionRouter,
)
from airbyte_cdk.sources.declarative.partition_routers.partition_router import PartitionRouter
from airbyte_cdk.sources.declarative.partition_routers.single_partition_router import (
SinglePartitionRouter,
)
from airbyte_cdk.sources.declarative.partition_routers.substream_partition_router import (
SubstreamPartitionRouter,
)

__all__ = [
"AsyncJobPartitionRouter",
"CartesianProductStreamSlicer",
"ListPartitionRouter",
"SinglePartitionRouter",
"SubstreamPartitionRouter",
"PartitionRouter"
"PartitionRouter",
]
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,24 @@
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#

from airbyte_cdk.sources.declarative.requesters.error_handlers.backoff_strategy import BackoffStrategy
from airbyte_cdk.sources.declarative.requesters.error_handlers.composite_error_handler import CompositeErrorHandler
from airbyte_cdk.sources.declarative.requesters.error_handlers.default_error_handler import DefaultErrorHandler
from airbyte_cdk.sources.declarative.requesters.error_handlers.backoff_strategy import (
BackoffStrategy,
)
from airbyte_cdk.sources.declarative.requesters.error_handlers.composite_error_handler import (
CompositeErrorHandler,
)
from airbyte_cdk.sources.declarative.requesters.error_handlers.default_error_handler import (
DefaultErrorHandler,
)
from airbyte_cdk.sources.declarative.requesters.error_handlers.error_handler import ErrorHandler
from airbyte_cdk.sources.declarative.requesters.error_handlers.http_response_filter import HttpResponseFilter
from airbyte_cdk.sources.declarative.requesters.error_handlers.http_response_filter import (
HttpResponseFilter,
)

__all__ = ["BackoffStrategy", "CompositeErrorHandler", "DefaultErrorHandler", "ErrorHandler", "HttpResponseFilter"]
__all__ = [
"BackoffStrategy",
"CompositeErrorHandler",
"DefaultErrorHandler",
"ErrorHandler",
"HttpResponseFilter",
]
Loading

0 comments on commit e4e3ffe

Please sign in to comment.