Skip to content

Commit

Permalink
Chore: Bump CDK dependency, DuckDB, Postgres, Pandas, and others (#383)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsteers authored Sep 23, 2024
1 parent b22a6b4 commit 4cd8167
Show file tree
Hide file tree
Showing 11 changed files with 265 additions and 82 deletions.
2 changes: 1 addition & 1 deletion airbyte/_processors/sql/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class PostgresConfig(SqlConfig):
def get_sql_alchemy_url(self) -> SecretString:
"""Return the SQLAlchemy URL to use."""
return SecretString(
f"postgresql+psycopg2://{self.username}:{self.password}@{self.host}:{self.port}/{self.database}"
f"postgresql://{self.username}:{self.password}@{self.host}:{self.port}/{self.database}"
)

@overrides
Expand Down
2 changes: 1 addition & 1 deletion airbyte/caches/_state_backend_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import abc
from typing import TYPE_CHECKING

from airbyte_protocol.models.airbyte_protocol import AirbyteStreamState
from airbyte_protocol.models import AirbyteStreamState


if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion airbyte/datasets/_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from overrides import overrides
from sqlalchemy import and_, func, select, text

from airbyte_protocol.models.airbyte_protocol import ConfiguredAirbyteStream
from airbyte_protocol.models import ConfiguredAirbyteStream

from airbyte.constants import DEFAULT_ARROW_MAX_CHUNK_SIZE
from airbyte.datasets._base import DatasetBase
Expand Down
2 changes: 1 addition & 1 deletion airbyte/shared/state_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from airbyte_protocol.models import (
AirbyteStateMessage,
AirbyteStateType,
AirbyteStreamState,
)
from airbyte_protocol.models.airbyte_protocol import AirbyteStreamState

from airbyte import exceptions as exc

Expand Down
2 changes: 1 addition & 1 deletion airbyte/shared/state_writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


if TYPE_CHECKING:
from airbyte_protocol.models.airbyte_protocol import AirbyteStateMessage
from airbyte_protocol.models import AirbyteStateMessage


class StateWriterBase(StateProviderBase, abc.ABC):
Expand Down
2 changes: 1 addition & 1 deletion airbyte/sources/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from collections.abc import Generator, Iterable, Iterator

from airbyte_cdk import ConnectorSpecification
from airbyte_protocol.models.airbyte_protocol import AirbyteStream
from airbyte_protocol.models import AirbyteStream

from airbyte._executors.base import Executor
from airbyte.caches import CacheBase
Expand Down
290 changes: 233 additions & 57 deletions poetry.lock

Large diffs are not rendered by default.

39 changes: 23 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,29 @@ enable = true
[tool.poetry.dependencies]
python = ">=3.10,<4.0"

airbyte-cdk = "^4.6.2"
duckdb = "^1.0.0"
duckdb-engine = "^0.13.0"
airbyte-cdk = "^5.6.0"
duckdb = "^1.1.0"
duckdb-engine = "^0.13.2"
google-auth = ">=2.27.0,<3.0"
google-cloud-bigquery = ">=3.12.0,<4.0"
google-cloud-secret-manager = "^2.17.0"
jsonschema = ">=3.2.0,<5.0"
numpy = "<2.0" # v2.0 causes "ValueError: numpy.dtype size changed" error
orjson = "^3.10"
overrides = "^7.4.0"
pandas = ">=1.5.3,<3.0"
pandas = { version = ">=1.5.3,<3.0" }
pendulum = "<=3.0.0"
psycopg2-binary = "^2.9.9"
# psycopg = {extras = ["binary", "pool"], version = "^3.1.16"}
# Psycopg3 is not supported in SQLAlchemy 1.x:
psycopg = {extras = ["binary", "pool"], version = "^3.2.2"}
psycopg2-binary = "^2.9.9"
pyarrow = ">=16.1,<18.0"
pydantic = ">=2.0,<=3.0"
python-dotenv = "^1.0.1"
python-ulid = "^2.2.0"
requests = "<=2.32.2,!=3.32.0" # 3.32.0 breaks docker tests
rich = "^13.7.0"
snowflake-connector-python = "^3.10.0"
snowflake-sqlalchemy = "^1.5.1"
sqlalchemy = "^2.0.35"
snowflake-connector-python = "^3.12.2"
snowflake-sqlalchemy = "^1.6.1"
sqlalchemy = ">=1.4.51,<3.0"
types-pyyaml = "^6.0.12.12"

# TODO: Remove this arbitrary python constraint once `sqlalchemy-bigquery` has done so.
Expand All @@ -49,11 +48,12 @@ pyiceberg = "^0.6.1"
uuid7 = "^0.1.0"
grpcio = "^1.65.0"
structlog = "^24.4.0"
airbyte-protocol-models-pdv2 = "^0.13.0"

[tool.poetry.group.dev.dependencies]
docker = "^7.0.0"
docker = "^7.1.0"
faker = "^21.0.0"
mypy = "^1.7.1"
mypy = "^1.11.2"
pandas-stubs = "^2.1.4.231218"
pdoc = "^14.3.0"
pytest = "^8.2.0"
Expand Down Expand Up @@ -91,7 +91,7 @@ markers = [
filterwarnings = [ # syntax: "action:message_regex:category:module:line"
# Treat python warnings as errors in pytest
"error",
# Snowflake reregisters its functions, which is fine.
# # Snowflake reregisters its functions, which is fine.
"ignore::sqlalchemy.exc.SAWarning", # "GenericFunction is already registered and is going to be overridden.""
# Ignore these, specifically on Windows because of file cleanup and locking issues:
"ignore:unclosed file:ResourceWarning",
Expand Down Expand Up @@ -217,7 +217,11 @@ airbyte = "ab"
[tool.ruff.lint.isort]
force-sort-within-sections = false
lines-after-imports = 2
known-first-party = ["airbyte_cdk", "airbyte_protocol"]
known-first-party = [
"airbyte_cdk",
"airbyte_protocol",
"airbyte_protocol_dataclasses",
]
known-local-folder = ["airbyte"]
required-imports = ["from __future__ import annotations"]
known-third-party = []
Expand Down Expand Up @@ -297,8 +301,11 @@ exclude = [
]

[[tool.mypy.overrides]]
module = ["airbyte_protocol", "airbyte_protocol.models"]
ignore_missing_imports = true # No stubs yet (😢)
ignore_missing_imports = true # No stubs yet (😢)
module = [
"airbyte_protocol",
"airbyte_protocol.models",
]

[tool.pyright]
pythonVersion = "3.10"
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import airbyte
import docker
import psycopg2 as psycopg
import psycopg
import pytest
import ulid
from _pytest.nodes import Item
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
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
from airbyte_protocol.models import AirbyteMessage, AirbyteRecordMessage, Type


@pytest.fixture
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/test_progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
_get_elapsed_time_str,
_to_time_str,
)
from airbyte_cdk import AirbyteMessage, AirbyteRecordMessage, Type
from airbyte_protocol.models import AirbyteMessage, AirbyteRecordMessage, Type
from dateutil.tz import tzlocal
from freezegun import freeze_time
from rich.errors import LiveError
Expand Down

0 comments on commit 4cd8167

Please sign in to comment.