Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Refactor: Rename module _future_cdk to shared #354

Merged
merged 3 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions airbyte/_processors/sql/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
from sqlalchemy.engine import make_url

from airbyte import exceptions as exc
from airbyte._future_cdk import SqlProcessorBase
from airbyte._future_cdk.sql_processor import SqlConfig
from airbyte._writers.jsonl import JsonlWriter
from airbyte.constants import DEFAULT_CACHE_SCHEMA_NAME
from airbyte.secrets.base import SecretString
from airbyte.shared import SqlProcessorBase
from airbyte.shared.sql_processor import SqlConfig
from airbyte.types import SQLTypeConverter


Expand Down
4 changes: 2 additions & 2 deletions airbyte/_processors/sql/duckdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
from overrides import overrides
from pydantic import Field

from airbyte._future_cdk import SqlProcessorBase
from airbyte._future_cdk.sql_processor import SqlConfig
from airbyte._writers.jsonl import JsonlWriter
from airbyte.secrets.base import SecretString
from airbyte.shared import SqlProcessorBase
from airbyte.shared.sql_processor import SqlConfig


if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion airbyte/_processors/sql/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

from overrides import overrides

from airbyte._future_cdk.sql_processor import SqlConfig, SqlProcessorBase
from airbyte._writers.jsonl import JsonlWriter
from airbyte.secrets.base import SecretString
from airbyte.shared.sql_processor import SqlConfig, SqlProcessorBase


class PostgresConfig(SqlConfig):
Expand Down
4 changes: 2 additions & 2 deletions airbyte/_processors/sql/snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
from snowflake.sqlalchemy import URL, VARIANT

from airbyte import exceptions as exc
from airbyte._future_cdk import SqlProcessorBase
from airbyte._future_cdk.sql_processor import SqlConfig
from airbyte._writers.jsonl import JsonlWriter
from airbyte.constants import DEFAULT_CACHE_SCHEMA_NAME
from airbyte.secrets.base import SecretString
from airbyte.shared import SqlProcessorBase
from airbyte.shared.sql_processor import SqlConfig
from airbyte.types import SQLTypeConverter


Expand Down
4 changes: 2 additions & 2 deletions airbyte/_writers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@


if TYPE_CHECKING:
from airbyte._future_cdk.catalog_providers import CatalogProvider
from airbyte._future_cdk.state_writers import StateWriterBase
from airbyte._message_iterators import AirbyteMessageIterator
from airbyte.progress import ProgressTracker
from airbyte.shared.catalog_providers import CatalogProvider
from airbyte.shared.state_writers import StateWriterBase
from airbyte.strategies import WriteStrategy


Expand Down
4 changes: 2 additions & 2 deletions airbyte/_writers/file_writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
AirbyteRecordMessage,
)

from airbyte._future_cdk.catalog_providers import CatalogProvider
from airbyte._future_cdk.state_writers import StateWriterBase
from airbyte._message_iterators import AirbyteMessageIterator
from airbyte.progress import ProgressTracker
from airbyte.shared.catalog_providers import CatalogProvider
from airbyte.shared.state_writers import StateWriterBase
from airbyte.strategies import WriteStrategy


Expand Down
2 changes: 1 addition & 1 deletion airbyte/caches/_catalog_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
SyncMode,
)

from airbyte._future_cdk.catalog_providers import CatalogProvider
from airbyte.shared.catalog_providers import CatalogProvider


if TYPE_CHECKING:
Expand Down
6 changes: 3 additions & 3 deletions airbyte/caches/_state_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
AirbyteStateType,
)

from airbyte._future_cdk.state_providers import StaticInputState
from airbyte._future_cdk.state_writers import StateWriterBase
from airbyte.caches._state_backend_base import (
StateBackendBase,
)
from airbyte.exceptions import PyAirbyteInputError, PyAirbyteInternalError
from airbyte.shared.state_providers import StaticInputState
from airbyte.shared.state_writers import StateWriterBase


if TYPE_CHECKING:
from sqlalchemy.engine import Engine

from airbyte._future_cdk.state_providers import StateProviderBase
from airbyte.shared.state_providers import StateProviderBase


CACHE_STATE_TABLE_NAME = "_airbyte_state"
Expand Down
4 changes: 2 additions & 2 deletions airbyte/caches/_state_backend_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
AirbyteStreamState,
)

from airbyte._future_cdk.state_providers import StateProviderBase
from airbyte._future_cdk.state_writers import StateWriterBase
from airbyte.shared.state_providers import StateProviderBase
from airbyte.shared.state_writers import StateWriterBase


class StateBackendBase(abc.ABC):
Expand Down
18 changes: 9 additions & 9 deletions airbyte/caches/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,29 @@

from airbyte_protocol.models import ConfiguredAirbyteCatalog

from airbyte._future_cdk.catalog_providers import CatalogProvider
from airbyte._future_cdk.sql_processor import (
SqlConfig,
SqlProcessorBase,
)
from airbyte._future_cdk.state_writers import StdOutStateWriter
from airbyte._writers.base import AirbyteWriterInterface
from airbyte.caches._catalog_backend import CatalogBackendBase, SqlCatalogBackend
from airbyte.caches._state_backend import SqlStateBackend
from airbyte.constants import DEFAULT_ARROW_MAX_CHUNK_SIZE, TEMP_FILE_CLEANUP
from airbyte.datasets._sql import CachedDataset
from airbyte.shared.catalog_providers import CatalogProvider
from airbyte.shared.sql_processor import (
SqlConfig,
SqlProcessorBase,
)
from airbyte.shared.state_writers import StdOutStateWriter


if TYPE_CHECKING:
from collections.abc import Iterator

from airbyte._future_cdk.sql_processor import SqlProcessorBase
from airbyte._future_cdk.state_providers import StateProviderBase
from airbyte._future_cdk.state_writers import StateWriterBase
from airbyte._message_iterators import AirbyteMessageIterator
from airbyte.caches._state_backend_base import StateBackendBase
from airbyte.datasets._base import DatasetBase
from airbyte.progress import ProgressTracker
from airbyte.shared.sql_processor import SqlProcessorBase
from airbyte.shared.state_providers import StateProviderBase
from airbyte.shared.state_writers import StateWriterBase
from airbyte.strategies import WriteStrategy


Expand Down
2 changes: 1 addition & 1 deletion airbyte/caches/snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

from pydantic import PrivateAttr

from airbyte._future_cdk.sql_processor import RecordDedupeMode
from airbyte._processors.sql.snowflake import SnowflakeConfig, SnowflakeSqlProcessor
from airbyte.caches.base import CacheBase
from airbyte.shared.sql_processor import RecordDedupeMode


class SnowflakeCache(SnowflakeConfig, CacheBase):
Expand Down
16 changes: 8 additions & 8 deletions airbyte/destinations/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,27 @@

from airbyte import exceptions as exc
from airbyte._connector_base import ConnectorBase
from airbyte._future_cdk.catalog_providers import CatalogProvider
from airbyte._future_cdk.state_providers import (
JoinedStateProvider,
StateProviderBase,
StaticInputState,
)
from airbyte._future_cdk.state_writers import NoOpStateWriter, StdOutStateWriter
from airbyte._message_iterators import AirbyteMessageIterator
from airbyte._util.temp_files import as_temp_files
from airbyte._writers.base import AirbyteWriterInterface
from airbyte.caches.util import get_default_cache
from airbyte.progress import ProgressTracker
from airbyte.results import ReadResult, WriteResult
from airbyte.shared.catalog_providers import CatalogProvider
from airbyte.shared.state_providers import (
JoinedStateProvider,
StateProviderBase,
StaticInputState,
)
from airbyte.shared.state_writers import NoOpStateWriter, StdOutStateWriter
from airbyte.sources.base import Source
from airbyte.strategies import WriteStrategy


if TYPE_CHECKING:
from airbyte._executors.base import Executor
from airbyte._future_cdk.state_writers import StateWriterBase
from airbyte.caches.base import CacheBase
from airbyte.shared.state_writers import StateWriterBase


class Destination(ConnectorBase, AirbyteWriterInterface):
Expand Down
6 changes: 3 additions & 3 deletions airbyte/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@

from sqlalchemy.engine import Engine

from airbyte._future_cdk.catalog_providers import CatalogProvider
from airbyte._future_cdk.state_providers import StateProviderBase
from airbyte._future_cdk.state_writers import StateWriterBase
from airbyte._writers.base import AirbyteWriterInterface
from airbyte.caches import CacheBase
from airbyte.destinations.base import Destination
from airbyte.progress import ProgressTracker
from airbyte.shared.catalog_providers import CatalogProvider
from airbyte.shared.state_providers import StateProviderBase
from airbyte.shared.state_writers import StateWriterBase
from airbyte.sources.base import Source


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from __future__ import annotations

from airbyte._future_cdk.sql_processor import SqlProcessorBase
from airbyte.shared.sql_processor import SqlProcessorBase


__all__ = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
)

from airbyte import exceptions as exc
from airbyte._future_cdk.state_writers import StdOutStateWriter
from airbyte._util.name_normalizers import LowerCaseNormalizer
from airbyte.constants import (
AB_EXTRACTED_AT_COLUMN,
Expand All @@ -50,6 +49,7 @@
DEBUG_MODE,
)
from airbyte.records import StreamRecordHandler
from airbyte.shared.state_writers import StdOutStateWriter
from airbyte.strategies import WriteMethod, WriteStrategy
from airbyte.types import SQLTypeConverter

Expand All @@ -64,11 +64,11 @@
from sqlalchemy.sql.type_api import TypeEngine

from airbyte._batch_handles import BatchHandle
from airbyte._future_cdk.catalog_providers import CatalogProvider
from airbyte._future_cdk.state_writers import StateWriterBase
from airbyte._writers.jsonl import FileWriterBase
from airbyte.progress import ProgressTracker
from airbyte.secrets.base import SecretString
from airbyte.shared.catalog_providers import CatalogProvider
from airbyte.shared.state_writers import StateWriterBase


class RecordDedupeMode(enum.Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import abc
from typing import TYPE_CHECKING, NoReturn, final

from airbyte._future_cdk.state_providers import StateProviderBase
from airbyte.shared.state_providers import StateProviderBase


if TYPE_CHECKING:
Expand Down
6 changes: 3 additions & 3 deletions airbyte/sources/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@

from airbyte import exceptions as exc
from airbyte._connector_base import ConnectorBase
from airbyte._future_cdk.catalog_providers import CatalogProvider
from airbyte._message_iterators import AirbyteMessageIterator
from airbyte._util.temp_files import as_temp_files
from airbyte.caches.util import get_default_cache
from airbyte.datasets._lazy import LazyDataset
from airbyte.progress import ProgressStyle, ProgressTracker
from airbyte.records import StreamRecord, StreamRecordHandler
from airbyte.results import ReadResult
from airbyte.shared.catalog_providers import CatalogProvider
from airbyte.strategies import WriteStrategy


Expand All @@ -42,10 +42,10 @@
from airbyte_protocol.models.airbyte_protocol import AirbyteStream

from airbyte._executors.base import Executor
from airbyte._future_cdk.state_providers import StateProviderBase
from airbyte._future_cdk.state_writers import StateWriterBase
from airbyte.caches import CacheBase
from airbyte.documents import Document
from airbyte.shared.state_providers import StateProviderBase
from airbyte.shared.state_writers import StateWriterBase


class Source(ConnectorBase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
from airbyte import get_source
from airbyte._executors.base import Executor
from airbyte._executors.util import get_connector_executor
from airbyte._future_cdk.catalog_providers import CatalogProvider
from airbyte._message_iterators import AirbyteMessageIterator
from airbyte.caches.util import new_local_cache
from airbyte.destinations.base import Destination
from airbyte.progress import ProgressTracker
from airbyte.results import ReadResult, WriteResult
from airbyte.shared.catalog_providers import CatalogProvider
from airbyte.sources.base import Source
from airbyte.strategies import WriteStrategy
from airbyte_cdk import AirbyteMessage, AirbyteRecordMessage, Type
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/test_source_test_fixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
from airbyte._executors.docker import DockerExecutor
from airbyte._executors.local import PathExecutor
from airbyte._executors.python import VenvExecutor
from airbyte._future_cdk.sql_processor import SqlProcessorBase
from airbyte._util.venv_util import get_bin_dir
from airbyte.caches import PostgresCache, SnowflakeCache
from airbyte.constants import AB_INTERNAL_COLUMNS
from airbyte.datasets import CachedDataset, LazyDataset, SQLDataset
from airbyte.results import ReadResult
from airbyte.shared.sql_processor import SqlProcessorBase
from airbyte.sources import registry
from airbyte.version import get_version
from sqlalchemy import column, text
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/test_state_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import airbyte as ab
import pytest
import ulid
from airbyte._future_cdk.state_writers import StateWriterBase
from airbyte.caches.duckdb import DuckDBCache
from airbyte.caches.util import new_local_cache
from airbyte.shared.state_writers import StateWriterBase
from airbyte_protocol import models

# Product count is always the same, regardless of faker scale.
Expand Down
Loading