Skip to content

Commit d4ecf7e

Browse files
authored
Merge pull request dbt-msft#716 from joshmarkovic/fix/audit-quick-wins-2
Quick-win fixes: badge, exception type, is_integer, CI matrix, dead code
2 parents 68f7a36 + 39740ef commit d4ecf7e

6 files changed

Lines changed: 7 additions & 15 deletions

File tree

.github/workflows/publish-docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
publish-docker-client:
1414
strategy:
1515
matrix:
16-
python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
16+
python_version: ["3.10", "3.11", "3.12", "3.13"]
1717
docker_target: ["msodbc17", "msodbc18", "mssql"]
1818
runs-on: ubuntu-latest
1919
permissions:

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ flags:
151151

152152
[![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)
153153
[![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)
154-
[![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)
155154

156155
This adapter is community-maintained.
157156
You are welcome to contribute by creating issues, opening or reviewing pull requests, or helping other users in the Slack channel.

dbt/adapters/sqlserver/sqlserver_auth.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
from itertools import chain, repeat
1212
from typing import TYPE_CHECKING, Any, Callable, Dict, Mapping, Optional, cast
1313

14+
import dbt_common.exceptions
15+
1416
from dbt.adapters.events.logging import AdapterLogger
1517
from dbt.adapters.sqlserver.sqlserver_constants import (
1618
AAD_TOKEN_AUTHENTICATIONS,
@@ -292,11 +294,9 @@ def get_pyodbc_attrs_before_credentials(credentials: SQLServerCredentials) -> Di
292294

293295
if authentication == "activedirectoryaccesstoken":
294296
if credentials.access_token is None or credentials.access_token_expires_on is None:
295-
raise ValueError(
296-
(
297-
"Access token and a non-zero access token expiry epoch timestamp are "
298-
"required for ActiveDirectoryAccessToken authentication."
299-
)
297+
raise dbt_common.exceptions.DbtRuntimeError(
298+
"Access token and a non-zero access token expiry epoch timestamp are "
299+
"required for ActiveDirectoryAccessToken authentication."
300300
)
301301

302302
if credentials.access_token_expires_on == 0:

dbt/include/sqlserver/macros/materializations/models/table/clone.sql

Lines changed: 0 additions & 4 deletions
This file was deleted.

dbt/include/sqlserver/macros/relations/views/create.sql

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
CREATE OR ALTER VIEW {{ relation.include(database=False) }} AS {{ sql }};
1717
{% endset %}
1818
19-
{% set tst %}
20-
SELECT '1' as col
21-
{% endset %}
2219
USE [{{ relation.database }}];
2320
EXEC('{{- escape_single_quotes(query) -}}')
2421

tests/unit/adapters/mssql/test_sqlserver_connection_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def test_get_pyodbc_attrs_before_active_directory_access_token_requires_expiry(
118118
credentials.access_token = "some-token"
119119

120120
credentials.access_token_expires_on = None
121-
with pytest.raises(ValueError, match="access token expiry"):
121+
with pytest.raises(DbtRuntimeError, match="access token expiry"):
122122
get_pyodbc_attrs_before_credentials(credentials)
123123

124124

0 commit comments

Comments
 (0)