Skip to content

Commit

Permalink
fix last test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-mkeller committed Nov 8, 2024
1 parent 480f064 commit 16986f5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ jobs:
mkdir -p ~/.snowflake
gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETERS_SECRET" \
.github/workflows/connections/connections_${{ matrix.cloud-provider }}.toml.gpg > ~/.snowflake/connections.toml
chmod 0600 "/home/runner/.snowflake/connections.toml" || true
- name: Download wheel(s)
uses: actions/download-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion src/snowflake/connector/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def read_config(
continue

if (
sliceoptions.check_permissions # Skip checking if this file couldn't hold sensitive information
sliceoptions.check_permissions # Skip checking if this slice isn't holding sensitive information
# Same check as openssh does for permissions
# https://github.com/openssh/openssh-portable/blob/2709809fd616a0991dc18e3a58dea10fb383c3f0/readconf.c#LL2264C1-L2264C1
and filep.stat().st_mode & READABLE_BY_OTHERS != 0
Expand Down
13 changes: 6 additions & 7 deletions src/snowflake/connector/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -1338,13 +1338,12 @@ def cmd_query(
data["queryContextDTO"] = queryContext
client = "sfsql_file_transfer" if is_file_transfer else "sfsql"

if logger.getEffectiveLevel() <= logging.DEBUG:
logger.debug(
"sql=[%s], sequence_id=[%s], is_file_transfer=[%s]",
self._format_query_for_log(data["sqlText"]),
data["sequenceId"],
is_file_transfer,
)
logger.debug(
"sql=[%s], sequence_id=[%s], is_file_transfer=[%s]",
self._format_query_for_log(data["sqlText"]),
data["sequenceId"],
is_file_transfer,
)

url_parameters = {REQUEST_ID: request_id}

Expand Down
4 changes: 3 additions & 1 deletion test/integ/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import snowflake.connector
from snowflake.connector import DatabaseError, OperationalError, ProgrammingError
from snowflake.connector.compat import IS_WINDOWS
from snowflake.connector.connection import (
DEFAULT_CLIENT_PREFETCH_THREADS,
SnowflakeConnection,
Expand Down Expand Up @@ -747,7 +748,8 @@ def test_invalid_connection_parameters_turned_off(conn_cnx):
) as conn:
assert conn._autocommit == "True"
assert conn._applucation == "this is a typo or my own variable"
assert len(w) == 0
# TODO: Windows tests will emit a warning about connections file privileges
assert len(w) == (1 if IS_WINDOWS else 0)


def test_invalid_connection_parameters_only_warns(conn_cnx):
Expand Down

0 comments on commit 16986f5

Please sign in to comment.