Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/snowflake/connector/aio/_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ async def request(
_include_retry_params: bool = False,
_no_retry: bool = False,
):
# log to reflect vendored.urllib3.connectionpool:connectionpool.py:474
logger.debug("%s %s", method.upper(), url)
if body is None:
body = {}
if self.master_token is None and self.token is None:
Expand Down
4 changes: 1 addition & 3 deletions src/snowflake/connector/aio/_result_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ async def fetch_all_data(self):
item,
)
rets.extend(batch)
# yield to avoid blocking the event loop for too long when processing large result sets
# await asyncio.sleep(0)
await self._final()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose not caring about the above comment is caused by the fact that user can just use 'async queries' - in Snowflake meaning?

return rets

async def generator(self):
Expand Down Expand Up @@ -285,7 +284,6 @@ async def _finish_iterating(self) -> None:

async def _report_metrics(self) -> None:
"""Report metrics for the result set."""
# TODO: SNOW-1572217 async telemetry
"""Report all metrics totalled up.
This includes TIME_CONSUME_LAST_RESULT, TIME_DOWNLOADING_CHUNKS and
Expand Down
6 changes: 2 additions & 4 deletions test/integ/aio_it/test_connection_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -1408,9 +1408,7 @@ async def test_mock_non_existing_server(conn_cnx, caplog):
)


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

assert "POST /telemetry/send" in caplog.text
caplog.clear()
Expand Down
Loading