Skip to content

Commit

Permalink
Merge branch 'main' into 1.9.latest
Browse files Browse the repository at this point in the history
  • Loading branch information
benc-db committed Aug 12, 2024
2 parents 3577f85 + 25807a8 commit 708cf60
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
- Fix places where we were not properly closing cursors, and other test warnings ([713](https://github.com/databricks/dbt-databricks/pull/713))
- Upgrade databricks-sql-connector dependency to 3.2.0 ([729](https://github.com/databricks/dbt-databricks/pull/729))

## dbt-databricks 1.8.5 (TBD)
## dbt-databricks 1.8.5 (August 6, 2024)

### Fixes

- Alter column statements are now done before the alter table statement (thanks @frankivo!). ([731](https://github.com/databricks/dbt-databricks/pull/731))
- Always use lower case when gathering metadata (since objects are stored internally as lower case regardless of how we create them) ([742](https://github.com/databricks/dbt-databricks/pull/742))
- Persist table comments for python models ([743](https://github.com/databricks/dbt-databricks/pull/743))
- Stop cursor destructor warnings ([744](https://github.com/databricks/dbt-databricks/pull/744))
- Race condition on cluster creation. (thanks @jurasan!) ([751](https://github.com/databricks/dbt-databricks/pull/751))

## dbt-databricks 1.8.4 (July 17, 2024)

Expand Down
2 changes: 1 addition & 1 deletion dbt/adapters/databricks/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version: str = "1.8.4"
version: str = "1.8.5"
8 changes: 6 additions & 2 deletions dbt/adapters/databricks/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,18 @@ def acquire_connection(

# override
@contextmanager
def connection_named(self, name: str, query_header_context: Any = None) -> Iterator[None]:
def connection_named(
self, name: str, query_header_context: Any = None, should_release_connection: bool = True
) -> Iterator[None]:
try:
if self.connections.query_header is not None:
self.connections.query_header.set(name, query_header_context)
self.acquire_connection(name, query_header_context)
yield
finally:
self.release_connection()
if should_release_connection:
self.release_connection()

if self.connections.query_header is not None:
self.connections.query_header.reset()

Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
databricks-sql-connector>=3.2.0, <3.3.0
dbt-spark~=1.8.0
dbt-core~=1.8.0
dbt-adapters~=1.2.0
dbt-core>=1.8.0, <2.0
dbt-adapters>=1.3.0, <2.0
databricks-sdk==0.17.0
keyring>=23.13.0
protobuf<5.0.0
protobuf<5.0.0
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def _get_plugin_version() -> str:
include_package_data=True,
install_requires=[
"dbt-spark>=1.8.0, <2.0",
"dbt-core~=1.8.0",
"dbt-adapters~=1.2.0",
"dbt-core>=1.8.0, <2.0",
"dbt-adapters>=1.3.0, <2.0",
"databricks-sql-connector>=3.2.0, <3.3.0",
"databricks-sdk==0.17.0",
"keyring>=23.13.0",
Expand Down
4 changes: 3 additions & 1 deletion tests/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@ def _build_databricks_cluster_target(
"connect_retries": 3,
"connect_timeout": 5,
"retry_all": True,
"auth_type": "oauth",
"auth_type": os.getenv("DBT_DATABRICKS_AUTH_TYPE", "oauth"),
}
if catalog is not None:
profile["catalog"] = catalog
if schema is not None:
profile["schema"] = schema
if session_properties is not None:
profile["session_properties"] = session_properties
if os.getenv("DBT_DATABRICKS_PORT"):
profile["connection_parameters"] = {"_port": os.getenv("DBT_DATABRICKS_PORT")}
return profile


Expand Down

0 comments on commit 708cf60

Please sign in to comment.