Skip to content

Commit 9d0a391

Browse files
[ASYNC] Apply #2264 to async code
1 parent 33bf463 commit 9d0a391

File tree

2 files changed

+0
-43
lines changed

2 files changed

+0
-43
lines changed

src/snowflake/connector/aio/_connection.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,6 @@ async def __open_connection(self):
306306
backoff_generator=self._backoff_generator,
307307
)
308308
elif self._authenticator == PROGRAMMATIC_ACCESS_TOKEN:
309-
if not self._token and self._password:
310-
self._token = self._password
311309
self.auth_class = AuthByPAT(self._token)
312310
elif self._authenticator == USR_PWD_MFA_AUTHENTICATOR:
313311
self._session_parameters[PARAMETER_CLIENT_REQUEST_MFA_TOKEN] = (

test/unit/aio/test_programmatic_access_token_async.py

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ def wiremock_client() -> Generator[WiremockClient | Any, Any, None]:
2727

2828

2929
@pytest.mark.skipolddriver
30-
@pytest.mark.asyncio
3130
async def test_valid_pat_async(wiremock_client: WiremockClient) -> None:
3231
wiremock_data_dir = (
3332
pathlib.Path(__file__).parent.parent.parent
@@ -65,7 +64,6 @@ async def test_valid_pat_async(wiremock_client: WiremockClient) -> None:
6564

6665

6766
@pytest.mark.skipolddriver
68-
@pytest.mark.asyncio
6967
async def test_invalid_pat_async(wiremock_client: WiremockClient) -> None:
7068
wiremock_data_dir = (
7169
pathlib.Path(__file__).parent.parent.parent
@@ -90,42 +88,3 @@ async def test_invalid_pat_async(wiremock_client: WiremockClient) -> None:
9088
await connection.connect()
9189

9290
assert str(execinfo.value).endswith("Programmatic access token is invalid.")
93-
94-
95-
@pytest.mark.skipolddriver
96-
@pytest.mark.asyncio
97-
async def test_pat_as_password_async(wiremock_client: WiremockClient) -> None:
98-
wiremock_data_dir = (
99-
pathlib.Path(__file__).parent.parent.parent
100-
/ "data"
101-
/ "wiremock"
102-
/ "mappings"
103-
/ "auth"
104-
/ "pat"
105-
)
106-
107-
wiremock_generic_data_dir = (
108-
pathlib.Path(__file__).parent.parent.parent
109-
/ "data"
110-
/ "wiremock"
111-
/ "mappings"
112-
/ "generic"
113-
)
114-
115-
wiremock_client.import_mapping(wiremock_data_dir / "successful_flow.json")
116-
wiremock_client.add_mapping(
117-
wiremock_generic_data_dir / "snowflake_disconnect_successful.json"
118-
)
119-
120-
connection = SnowflakeConnection(
121-
user="testUser",
122-
authenticator=PROGRAMMATIC_ACCESS_TOKEN,
123-
token=None,
124-
password="some PAT",
125-
account="testAccount",
126-
protocol="http",
127-
host=wiremock_client.wiremock_host,
128-
port=wiremock_client.wiremock_http_port,
129-
)
130-
await connection.connect()
131-
await connection.close()

0 commit comments

Comments
 (0)