Skip to content

Commit

Permalink
SNOW-1868288 log level to debug in chunk rowcount logging (#2127)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-dszmolka authored Jan 2, 2025
1 parent 343cc4b commit 138241c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ Source code is also available at: https://github.com/snowflakedb/snowflake-conne
- v3.12.5(TBD)
- Added a feature to limit the sizes of IO-bound ThreadPoolExecutors during PUT and GET commands.
- Adding support for the new PAT authentication method.
- Updated README.md to include instructions on how to verify package signatures using `cosign`.
- Updated README.md to include instructions on how to verify package signatures using `cosign`.
- Updated the log level for cursor's chunk rowcount from INFO to DEBUG

- v3.12.4(December 3,2024)
- Fixed a bug where multipart uploads to Azure would be missing their MD5 hashes.
Expand Down
2 changes: 1 addition & 1 deletion src/snowflake/connector/cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@ def _init_result_and_meta(self, data: dict[Any, Any]) -> None:
)

if not (is_dml or self.is_file_transfer):
logger.info(
logger.debug(
"Number of results in first chunk: %s", result_chunks[0].rowcount
)

Expand Down
3 changes: 3 additions & 0 deletions test/integ/test_cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def _type_from_description(named_access: bool):

@pytest.mark.skipolddriver
def test_insert_select(conn, db_parameters, caplog):
caplog.set_level(logging.DEBUG)
"""Inserts and selects integer data."""
with conn() as cnx:
c = cnx.cursor()
Expand Down Expand Up @@ -198,6 +199,7 @@ def test_insert_select(conn, db_parameters, caplog):

@pytest.mark.skipolddriver
def test_insert_and_select_by_separate_connection(conn, db_parameters, caplog):
caplog.set_level(logging.DEBUG)
"""Inserts a record and select it by a separate connection."""
with conn() as cnx:
result = cnx.cursor().execute(
Expand Down Expand Up @@ -933,6 +935,7 @@ def test_fetchmany(conn, db_parameters, caplog):
assert c.rowcount == 6, "number of records"

with cnx.cursor() as c:
caplog.set_level(logging.DEBUG)
c.execute(f"select aa from {table_name} order by aa desc")
assert "Number of results in first chunk: 6" in caplog.text

Expand Down

0 comments on commit 138241c

Please sign in to comment.