Skip to content

Commit

Permalink
chore: dbt-core to 1.3.0, block other dependencies to upgrade to major (
Browse files Browse the repository at this point in the history
#14) (#21)

Closes #12
  • Loading branch information
Jrmyy authored Nov 15, 2022
1 parent f4f0ccf commit ce48d04
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 20 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## v1.3.0

### Features
* Update `dbt-core` to 1.3.0

## v1.0.4

### Bugfixes
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# 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]
* Support two incremental update strategies: `insert_overwrite` and `append`
* 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

Expand Down
15 changes: 6 additions & 9 deletions dbt/adapters/athena/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
13 changes: 7 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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",
]
)

0 comments on commit ce48d04

Please sign in to comment.