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: 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. 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/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) -}}') 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)