From ce48d04af99d2ba47e242dbfffea3b1c2f6df7de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Guiselin?= <9251353+Jrmyy@users.noreply.github.com> Date: Tue, 15 Nov 2022 14:11:31 +0100 Subject: [PATCH] chore: dbt-core to 1.3.0, block other dependencies to upgrade to major (#14) (#21) Closes #12 --- CHANGELOG.md | 5 +++++ README.md | 4 +++- dbt/adapters/athena/connections.py | 15 ++++++--------- requirements.txt | 8 ++++---- setup.py | 13 +++++++------ 5 files changed, 25 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88a39a81..17b32655 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## v1.3.0 + +### Features +* Update `dbt-core` to 1.3.0 + ## v1.0.4 ### Bugfixes diff --git a/README.md b/README.md index 6e0d8682..e02181fd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # dbt-athena -* Supports dbt version `1.0.*` +* Supports dbt version `1.3.*` * Supports [Seeds][seeds] * Correctly detects views and their columns * Support [incremental models][incremental] @@ -8,10 +8,12 @@ * Does **not** support the use of `unique_key` * **Only** supports Athena engine 2 * [Changing Athena Engine Versions][engine-change] +* Does not support [Python models][python-models] [seeds]: https://docs.getdbt.com/docs/building-a-dbt-project/seeds [incremental]: https://docs.getdbt.com/docs/building-a-dbt-project/building-models/configuring-incremental-models [engine-change]: https://docs.aws.amazon.com/athena/latest/ug/engine-versions-changing.html +[python-models]: https://docs.getdbt.com/docs/build/python-models#configuring-python-models ### Installation diff --git a/dbt/adapters/athena/connections.py b/dbt/adapters/athena/connections.py index a2bb5374..c1c72a10 100644 --- a/dbt/adapters/athena/connections.py +++ b/dbt/adapters/athena/connections.py @@ -17,7 +17,7 @@ from pyathena.formatter import _DEFAULT_FORMATTERS, _escape_hive, _escape_presto from dbt.adapters.base import Credentials -from dbt.contracts.connection import Connection, AdapterResponse +from dbt.contracts.connection import Connection, AdapterResponse, ConnectionState from dbt.adapters.sql import SQLConnectionManager from dbt.exceptions import RuntimeException, FailedToConnectException from dbt.events import AdapterLogger @@ -159,17 +159,14 @@ def open(cls, connection: Connection) -> Connection: ), ) - connection.state = "open" + connection.state = ConnectionState.OPEN connection.handle = handle - except Exception as e: - logger.debug("Got an error when attempting to open a Athena " - "connection: '{}'" - .format(e)) + except Exception as exc: + logger.exception(f"Got an error when attempting to open a Athena connection due to {exc}") connection.handle = None - connection.state = "fail" - - raise FailedToConnectException(str(e)) + connection.state = ConnectionState.FAIL + raise FailedToConnectException(str(exc)) return connection diff --git a/requirements.txt b/requirements.txt index 0c7ce914..8682963e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -dbt-core>=1.0.1 -pyathena>=2.2.0 -boto3>=1.18.12 -tenacity>=6.3.1 +dbt-core~=1.3.0 +pyathena~=2.14 +boto3~=1.26 +tenacity~=8.1 diff --git a/setup.py b/setup.py index ea62a46f..a9979504 100644 --- a/setup.py +++ b/setup.py @@ -10,8 +10,8 @@ package_name = "dbt-athena-community" -dbt_version = "1.0" -package_version = "1.0.4" +dbt_version = "1.3" +package_version = "1.3.0" description = """The athena adapter plugin for dbt (data build tool)""" if not package_version.startswith(dbt_version): @@ -31,9 +31,10 @@ packages=find_namespace_packages(include=["dbt", "dbt.*"]), include_package_data=True, install_requires=[ - "dbt-core>=1.0.1", - "pyathena>=2.2.0", - "boto3>=1.18.12", - "tenacity>=6.3.1", + # In order to control dbt-core version and package version + "dbt-core~=1.3.0", + "pyathena~=2.14", + "boto3~=1.26", + "tenacity~=8.1", ] )