Skip to content

Commit 3e84eec

Browse files
SNOW-1759084: Adjust aio telemetry events
1 parent 24ea33d commit 3e84eec

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/snowflake/connector/aio/_network.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ async def request(
178178
_include_retry_params: bool = False,
179179
_no_retry: bool = False,
180180
):
181+
# log to reflect vendored.urllib3.connectionpool:connectionpool.py:474
182+
logger.debug("%s %s", method.upper(), url)
181183
if body is None:
182184
body = {}
183185
if self.master_token is None and self.token is None:

src/snowflake/connector/aio/_result_set.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ async def fetch_all_data(self):
103103
item,
104104
)
105105
rets.extend(batch)
106-
# yield to avoid blocking the event loop for too long when processing large result sets
107-
# await asyncio.sleep(0)
106+
await self._final()
108107
return rets
109108

110109
async def generator(self):
@@ -285,7 +284,6 @@ async def _finish_iterating(self) -> None:
285284

286285
async def _report_metrics(self) -> None:
287286
"""Report metrics for the result set."""
288-
# TODO: SNOW-1572217 async telemetry
289287
"""Report all metrics totalled up.
290288
291289
This includes TIME_CONSUME_LAST_RESULT, TIME_DOWNLOADING_CHUNKS and

test/integ/aio_it/test_connection_async.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,9 +1415,7 @@ async def test_mock_non_existing_server(conn_cnx, caplog):
14151415
)
14161416

14171417

1418-
@pytest.mark.xfail(
1419-
reason="TODO: SNOW-1759084 await anext(self._generator, None) does not execute code after yield"
1420-
)
1418+
@pytest.mark.skipolddriver
14211419
async def test_disable_telemetry(conn_cnx, caplog):
14221420
# default behavior, closing connection, it will send telemetry
14231421
with caplog.at_level(logging.DEBUG):
@@ -1426,7 +1424,7 @@ async def test_disable_telemetry(conn_cnx, caplog):
14261424
await (await cur.execute("select 1")).fetchall()
14271425
assert (
14281426
len(conn._telemetry._log_batch) == 3
1429-
) # 3 events are `import package`, `fetch first`, it's missing `fetch last` because of SNOW-1759084
1427+
) # 3 events are `import package`, `fetch first`, `fetch last`
14301428

14311429
assert "POST /telemetry/send" in caplog.text
14321430
caplog.clear()

0 commit comments

Comments
 (0)