From 4d0e9e30be3dd21c45fb6454fd27de70bb7eb9ab Mon Sep 17 00:00:00 2001 From: Josh Markovic Date: Tue, 16 Jun 2026 20:41:27 +0000 Subject: [PATCH 1/4] docs: remove broken Integration tests on Azure badge The integration-tests-azure.yml workflow does not exist, so the badge always rendered broken. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index f3a9fe22..2c40498e 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,6 @@ The same setting is also honoured via `vars:` for backwards compatibility; the b [![Unit tests](https://github.com/dbt-msft/dbt-sqlserver/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/dbt-msft/dbt-sqlserver/actions/workflows/unit-tests.yml) [![Integration tests on SQL Server](https://github.com/dbt-msft/dbt-sqlserver/actions/workflows/integration-tests-sqlserver.yml/badge.svg)](https://github.com/dbt-msft/dbt-sqlserver/actions/workflows/integration-tests-sqlserver.yml) -[![Integration tests on Azure](https://github.com/dbt-msft/dbt-sqlserver/actions/workflows/integration-tests-azure.yml/badge.svg)](https://github.com/dbt-msft/dbt-sqlserver/actions/workflows/integration-tests-azure.yml) This adapter is community-maintained. You are welcome to contribute by creating issues, opening or reviewing pull requests, or helping other users in the Slack channel. From 3c9f3f440a4e1fc97e76e3d3373e4d3ac7a30e4b Mon Sep 17 00:00:00 2001 From: Josh Markovic Date: Tue, 16 Jun 2026 20:41:27 +0000 Subject: [PATCH 2/4] fix: raise DbtRuntimeError instead of ValueError for missing access token ActiveDirectoryAccessToken config faults now surface as a dbt error, consistent with the other auth/config validations in this layer. Updates the unit test that asserted the old type. --- dbt/adapters/sqlserver/sqlserver_auth.py | 10 +++++----- .../mssql/test_sqlserver_connection_manager.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dbt/adapters/sqlserver/sqlserver_auth.py b/dbt/adapters/sqlserver/sqlserver_auth.py index 3a7993fb..8985ff66 100644 --- a/dbt/adapters/sqlserver/sqlserver_auth.py +++ b/dbt/adapters/sqlserver/sqlserver_auth.py @@ -11,6 +11,8 @@ from itertools import chain, repeat from typing import TYPE_CHECKING, Any, Callable, Dict, Mapping, Optional, cast +import dbt_common.exceptions + from dbt.adapters.events.logging import AdapterLogger from dbt.adapters.sqlserver.sqlserver_constants import ( AAD_TOKEN_AUTHENTICATIONS, @@ -292,11 +294,9 @@ def get_pyodbc_attrs_before_credentials(credentials: SQLServerCredentials) -> Di if authentication == "activedirectoryaccesstoken": if credentials.access_token is None or credentials.access_token_expires_on is None: - raise ValueError( - ( - "Access token and a non-zero access token expiry epoch timestamp are " - "required for ActiveDirectoryAccessToken authentication." - ) + raise dbt_common.exceptions.DbtRuntimeError( + "Access token and a non-zero access token expiry epoch timestamp are " + "required for ActiveDirectoryAccessToken authentication." ) if credentials.access_token_expires_on == 0: diff --git a/tests/unit/adapters/mssql/test_sqlserver_connection_manager.py b/tests/unit/adapters/mssql/test_sqlserver_connection_manager.py index e1e315dd..a10b2810 100644 --- a/tests/unit/adapters/mssql/test_sqlserver_connection_manager.py +++ b/tests/unit/adapters/mssql/test_sqlserver_connection_manager.py @@ -118,7 +118,7 @@ def test_get_pyodbc_attrs_before_active_directory_access_token_requires_expiry( credentials.access_token = "some-token" credentials.access_token_expires_on = None - with pytest.raises(ValueError, match="access token expiry"): + with pytest.raises(DbtRuntimeError, match="access token expiry"): get_pyodbc_attrs_before_credentials(credentials) From 8bbc92eca609bf689db2a9b32544f53b3c9c066c Mon Sep 17 00:00:00 2001 From: Josh Markovic Date: Tue, 16 Jun 2026 20:41:27 +0000 Subject: [PATCH 3/4] ci: drop Python 3.9 from publish-docker matrix requires-python is >=3.10; the 3.9 images were unused by the unit/integration/release workflows. --- .github/workflows/publish-docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml index c422b56b..0a7bdb8f 100644 --- a/.github/workflows/publish-docker.yml +++ b/.github/workflows/publish-docker.yml @@ -13,7 +13,7 @@ jobs: publish-docker-client: strategy: matrix: - python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python_version: ["3.10", "3.11", "3.12", "3.13"] docker_target: ["msodbc17", "msodbc18", "mssql"] runs-on: ubuntu-latest permissions: From 39740efbd1f0b8cdff643e9fb7284742b5dc51b5 Mon Sep 17 00:00:00 2001 From: Josh Markovic Date: Tue, 16 Jun 2026 20:41:27 +0000 Subject: [PATCH 4/4] chore: remove dead clone macro and unused view scaffolding variable sqlserver__create_or_replace_clone was unreachable (sqlserver__can_clone_table returns False and dbt-core provides default__create_or_replace_clone) and emitted invalid T-SQL. The unused 'tst' set block in create_view_as is also removed. --- .../sqlserver/macros/materializations/models/table/clone.sql | 4 ---- dbt/include/sqlserver/macros/relations/views/create.sql | 3 --- 2 files changed, 7 deletions(-) delete mode 100644 dbt/include/sqlserver/macros/materializations/models/table/clone.sql diff --git a/dbt/include/sqlserver/macros/materializations/models/table/clone.sql b/dbt/include/sqlserver/macros/materializations/models/table/clone.sql deleted file mode 100644 index a5981283..00000000 --- a/dbt/include/sqlserver/macros/materializations/models/table/clone.sql +++ /dev/null @@ -1,4 +0,0 @@ -{% macro sqlserver__create_or_replace_clone(target_relation, defer_relation) %} - CREATE TABLE {{target_relation}} - AS CLONE OF {{defer_relation}} -{% endmacro %} diff --git a/dbt/include/sqlserver/macros/relations/views/create.sql b/dbt/include/sqlserver/macros/relations/views/create.sql index f5ec760c..2d614c38 100644 --- a/dbt/include/sqlserver/macros/relations/views/create.sql +++ b/dbt/include/sqlserver/macros/relations/views/create.sql @@ -16,9 +16,6 @@ CREATE OR ALTER VIEW {{ relation.include(database=False) }} AS {{ sql }}; {% endset %} - {% set tst %} - SELECT '1' as col - {% endset %} USE [{{ relation.database }}]; EXEC('{{- escape_single_quotes(query) -}}')