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

Update dbt-core to 1.5 and implement support for model contracts #163

Merged
merged 6 commits into from
Jan 11, 2024
Merged
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
Prev Previous commit
Allow Unix socket connection rather than just TCP (#165)
mwallace582 authored Jan 10, 2024
commit 358d4e4c4cc44fd6354299f96baf41fa95df4283
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
- Migrate CircleCI to GitHub Actions ([#120](https://github.com/dbeatty10/dbt-mysql/issues/120))
- Support dbt v1.4 ([#146](https://github.com/dbeatty10/dbt-mysql/pull/146))
- Support dbt v1.5 ([#145](https://github.com/dbeatty10/dbt-mysql/issues/145))
- Support connecting via UNIX sockets ([#164](https://github.com/dbeatty10/dbt-mysql/issues/164))

### Fixes
- Fix incremental composite keys ([#144](https://github.com/dbeatty10/dbt-mysql/issues/144))
@@ -12,7 +13,7 @@
- [@lpezet](https://github.com/lpezet) ([#146](https://github.com/dbeatty10/dbt-mysql/pull/146))
- [@moszutij](https://github.com/moszutij) ([#146](https://github.com/dbeatty10/dbt-mysql/pull/146), [#144](https://github.com/dbeatty10/dbt-mysql/issues/144))
- [@wesen](https://github.com/wesen) ([#146](https://github.com/dbeatty10/dbt-mysql/pull/146))
- [@mwallace582](https://github.com/mwallace582) ([#162](https://github.com/dbeatty10/dbt-mysql/pull/162), [#163](https://github.com/dbeatty10/dbt-mysql/pull/163))
- [@mwallace582](https://github.com/mwallace582) ([#162](https://github.com/dbeatty10/dbt-mysql/pull/162), [#163](https://github.com/dbeatty10/dbt-mysql/pull/163), [#164](https://github.com/dbeatty10/dbt-mysql/issues/164))


## dbt-mysql 1.1.0 (Feb 5, 2023)
10 changes: 8 additions & 2 deletions dbt/adapters/mariadb/connections.py
Original file line number Diff line number Diff line change
@@ -17,7 +17,8 @@

@dataclass(init=False)
class MariaDBCredentials(Credentials):
server: str
server: Optional[str] = None
unix_socket: Optional[str] = None
port: Optional[int] = None
database: Optional[str] = None
schema: str
@@ -62,6 +63,7 @@ def _connection_keys(self):
"""
return (
"server",
"unix_socket",
"port",
"database",
"schema",
@@ -81,14 +83,18 @@ def open(cls, connection):
credentials = cls.get_credentials(connection.credentials)
kwargs = {}

kwargs["host"] = credentials.server
kwargs["user"] = credentials.username
kwargs["passwd"] = credentials.password
kwargs["buffered"] = True

if credentials.ssl_disabled:
kwargs["ssl_disabled"] = credentials.ssl_disabled

if credentials.server:
kwargs["host"] = credentials.server
elif credentials.unix_socket:
kwargs["unix_socket"] = credentials.unix_socket

if credentials.port:
kwargs["port"] = credentials.port

10 changes: 8 additions & 2 deletions dbt/adapters/mysql/connections.py
Original file line number Diff line number Diff line change
@@ -17,7 +17,8 @@

@dataclass(init=False)
class MySQLCredentials(Credentials):
server: str
server: Optional[str] = None
unix_socket: Optional[str] = None
port: Optional[int] = None
database: Optional[str] = None
schema: str
@@ -61,6 +62,7 @@ def _connection_keys(self):
"""
return (
"server",
"unix_socket",
"port",
"database",
"schema",
@@ -80,11 +82,15 @@ def open(cls, connection):
credentials = cls.get_credentials(connection.credentials)
kwargs = {}

kwargs["host"] = credentials.server
kwargs["user"] = credentials.username
kwargs["passwd"] = credentials.password
kwargs["buffered"] = True

if credentials.server:
kwargs["host"] = credentials.server
elif credentials.unix_socket:
kwargs["unix_socket"] = credentials.unix_socket

if credentials.port:
kwargs["port"] = credentials.port

10 changes: 8 additions & 2 deletions dbt/adapters/mysql5/connections.py
Original file line number Diff line number Diff line change
@@ -17,7 +17,8 @@

@dataclass(init=False)
class MySQLCredentials(Credentials):
server: str
server: Optional[str] = None
unix_socket: Optional[str] = None
port: Optional[int] = None
database: Optional[str] = None
schema: str
@@ -62,6 +63,7 @@ def _connection_keys(self):
"""
return (
"server",
"unix_socket",
"port",
"database",
"schema",
@@ -81,14 +83,18 @@ def open(cls, connection):
credentials = cls.get_credentials(connection.credentials)
kwargs = {}

kwargs["host"] = credentials.server
kwargs["user"] = credentials.username
kwargs["passwd"] = credentials.password
kwargs["buffered"] = True

if credentials.ssl_disabled:
kwargs["ssl_disabled"] = credentials.ssl_disabled

if credentials.server:
kwargs["host"] = credentials.server
elif credentials.unix_socket:
kwargs["unix_socket"] = credentials.unix_socket

if credentials.port:
kwargs["port"] = credentials.port