Skip to content

Commit 007bd79

Browse files
[async] review changes
1 parent 92121a5 commit 007bd79

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/snowflake/connector/aio/_result_batch.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,24 +240,23 @@ async def download_chunk(http_session):
240240
request_data["timeout"] = aiohttp.ClientTimeout(
241241
total=DOWNLOAD_TIMEOUT
242242
)
243+
request_url = request_data["url"]
243244
# Use SessionManager with same fallback pattern as sync version
244245
if (
245246
connection
246247
and connection.rest
247248
and connection.rest.session_manager is not None
248249
):
249250
# If connection was explicitly passed and not closed yet - we can reuse SessionManager with session pooling
250-
async with connection.rest.use_session(
251-
request_data["url"]
252-
) as session:
251+
async with connection.rest.use_session(request_url) as session:
253252
logger.debug(
254253
f"downloading result batch id: {self.id} with existing session {session}"
255254
)
256255
response, content, encoding = await download_chunk(session)
257256
elif self._session_manager is not None:
258257
# If connection is not accessible or was already closed, but cursors are now used to fetch the data - we will only reuse the http setup (through cloned SessionManager without session pooling)
259258
async with self._session_manager.use_session(
260-
request_data["url"]
259+
request_url
261260
) as session:
262261
response, content, encoding = await download_chunk(session)
263262
else:
@@ -269,7 +268,7 @@ async def download_chunk(http_session):
269268
use_pooling=False
270269
)
271270
async with local_session_manager.use_session(
272-
request_data["url"]
271+
request_url
273272
) as session:
274273
response, content, encoding = await download_chunk(session)
275274

0 commit comments

Comments
 (0)