From 0166bf9e307609c10bf3e628a12d3003ba0b4593 Mon Sep 17 00:00:00 2001 From: Ben Cassell <98852248+benc-db@users.noreply.github.com> Date: Mon, 11 Mar 2024 16:03:16 -0700 Subject: [PATCH] Backport: Pin Databricks SDK (#612) --- .github/workflows/build_cluster_http_path.py | 10 ++++++++-- CHANGELOG.md | 6 ++++++ dbt/adapters/databricks/__version__.py | 2 +- requirements.txt | 3 ++- setup.py | 3 ++- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_cluster_http_path.py b/.github/workflows/build_cluster_http_path.py index 7cc0b7314..264018019 100644 --- a/.github/workflows/build_cluster_http_path.py +++ b/.github/workflows/build_cluster_http_path.py @@ -1,13 +1,19 @@ import os +import re -workspace_id = os.getenv("DBT_DATABRICKS_HOST_NAME")[4:18] +workspace_re = re.compile(r"^.*-(\d+)\..*$") +hostname = os.getenv("DBT_DATABRICKS_HOST_NAME", "") +matches = workspace_re.match(hostname) +if matches: + workspace_id = matches.group(1) + print(workspace_id) cluster_id = os.getenv("TEST_PECO_CLUSTER_ID") uc_cluster_id = os.getenv("TEST_PECO_UC_CLUSTER_ID") http_path = f"sql/protocolv1/o/{workspace_id}/{cluster_id}" uc_http_path = f"sql/protocolv1/o/{workspace_id}/{uc_cluster_id}" # https://stackoverflow.com/a/72225291/5093960 -env_file = os.getenv("GITHUB_ENV") +env_file = os.getenv("GITHUB_ENV", "") with open(env_file, "a") as myfile: myfile.write(f"DBT_DATABRICKS_CLUSTER_HTTP_PATH={http_path}\n") myfile.write(f"DBT_DATABRICKS_UC_CLUSTER_HTTP_PATH={uc_http_path}\n") diff --git a/CHANGELOG.md b/CHANGELOG.md index 27b909ea8..1b0cff748 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## dbt-databricks 1.6.9 (March 11, 2023) + +### Fixes + +- Pin databricks-sdk to < 0.18.0 + ## dbt-databricks 1.6.8 (December 14, 2023) ### Fixes diff --git a/dbt/adapters/databricks/__version__.py b/dbt/adapters/databricks/__version__.py index 3eb5b31ad..72875b2a0 100644 --- a/dbt/adapters/databricks/__version__.py +++ b/dbt/adapters/databricks/__version__.py @@ -1 +1 @@ -version: str = "1.6.8" +version: str = "1.6.9" diff --git a/requirements.txt b/requirements.txt index 8c7af0eee..56be6577e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ databricks-sql-connector>=2.9.3, <3.0.0 dbt-spark~=1.6.2 -databricks-sdk==0.9.0 +databricks-sdk>=0.9.0, <0.16.0 keyring>=23.13.0 +pandas<2.2.0 \ No newline at end of file diff --git a/setup.py b/setup.py index 824734135..f3d6d6bf3 100644 --- a/setup.py +++ b/setup.py @@ -56,8 +56,9 @@ def _get_plugin_version(): install_requires=[ "dbt-spark~=1.6.2", "databricks-sql-connector>=2.9.3, <3.0.0", - "databricks-sdk>=0.9.0", + "databricks-sdk>=0.9.0, <0.16.0", "keyring>=23.13.0", + "pandas<2.2.0", ], zip_safe=False, classifiers=[