Skip to content

Commit 011eae4

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 480e7f7 commit 011eae4

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

dbt/adapters/sqlserver/sqlserver_connections.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
try:
1414
from azure.core.credentials import AccessToken
1515
except ModuleNotFoundError:
16+
1617
@dataclass
1718
class AccessToken:
1819
token: str
@@ -76,8 +77,9 @@ def _require_azure_identity(authentication: str) -> None:
7677
if _AZURE_IDENTITY_IMPORT_ERROR is not None:
7778
raise dbt_common.exceptions.DbtRuntimeError(
7879
"Azure authentication '{}' requires the optional dependency 'azure-identity'. "
79-
"Install it with `pip install azure-identity` or use a non-Azure authentication mode."
80-
.format(authentication)
80+
"Install it with `pip install azure-identity` or use a non-Azure authentication mode.".format(
81+
authentication
82+
)
8183
) from _AZURE_IDENTITY_IMPORT_ERROR
8284

8385

tests/unit/adapters/mssql/test_sqlserver_connection_manager.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ def test_get_pyodbc_attrs_before_empty_dict_when_service_principal(
3838
def test_get_pyodbc_attrs_before_sql_auth_without_azure_identity(
3939
credentials: SQLServerCredentials, monkeypatch: pytest.MonkeyPatch
4040
) -> None:
41-
monkeypatch.setattr(sqlserver_connections, "_AZURE_IDENTITY_IMPORT_ERROR", ModuleNotFoundError())
41+
monkeypatch.setattr(
42+
sqlserver_connections, "_AZURE_IDENTITY_IMPORT_ERROR", ModuleNotFoundError()
43+
)
4244

4345
attrs_before = get_pyodbc_attrs_before_credentials(credentials)
4446

@@ -49,7 +51,9 @@ def test_get_pyodbc_attrs_before_cli_auth_requires_azure_identity(
4951
credentials: SQLServerCredentials, monkeypatch: pytest.MonkeyPatch
5052
) -> None:
5153
credentials.authentication = "cli"
52-
monkeypatch.setattr(sqlserver_connections, "_AZURE_IDENTITY_IMPORT_ERROR", ModuleNotFoundError())
54+
monkeypatch.setattr(
55+
sqlserver_connections, "_AZURE_IDENTITY_IMPORT_ERROR", ModuleNotFoundError()
56+
)
5357

5458
with pytest.raises(DbtRuntimeError, match="requires the optional dependency 'azure-identity'"):
5559
get_pyodbc_attrs_before_credentials(credentials)

0 commit comments

Comments
 (0)