Skip to content

Commit 16986f5

Browse files
fix last test failure
1 parent 480f064 commit 16986f5

4 files changed

Lines changed: 11 additions & 9 deletions

File tree

.github/workflows/build_test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ jobs:
143143
mkdir -p ~/.snowflake
144144
gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETERS_SECRET" \
145145
.github/workflows/connections/connections_${{ matrix.cloud-provider }}.toml.gpg > ~/.snowflake/connections.toml
146+
chmod 0600 "/home/runner/.snowflake/connections.toml" || true
146147
- name: Download wheel(s)
147148
uses: actions/download-artifact@v4
148149
with:

src/snowflake/connector/config_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ def read_config(
330330
continue
331331

332332
if (
333-
sliceoptions.check_permissions # Skip checking if this file couldn't hold sensitive information
333+
sliceoptions.check_permissions # Skip checking if this slice isn't holding sensitive information
334334
# Same check as openssh does for permissions
335335
# https://github.com/openssh/openssh-portable/blob/2709809fd616a0991dc18e3a58dea10fb383c3f0/readconf.c#LL2264C1-L2264C1
336336
and filep.stat().st_mode & READABLE_BY_OTHERS != 0

src/snowflake/connector/connection.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,13 +1338,12 @@ def cmd_query(
13381338
data["queryContextDTO"] = queryContext
13391339
client = "sfsql_file_transfer" if is_file_transfer else "sfsql"
13401340

1341-
if logger.getEffectiveLevel() <= logging.DEBUG:
1342-
logger.debug(
1343-
"sql=[%s], sequence_id=[%s], is_file_transfer=[%s]",
1344-
self._format_query_for_log(data["sqlText"]),
1345-
data["sequenceId"],
1346-
is_file_transfer,
1347-
)
1341+
logger.debug(
1342+
"sql=[%s], sequence_id=[%s], is_file_transfer=[%s]",
1343+
self._format_query_for_log(data["sqlText"]),
1344+
data["sequenceId"],
1345+
is_file_transfer,
1346+
)
13481347

13491348
url_parameters = {REQUEST_ID: request_id}
13501349

test/integ/test_connection.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
import snowflake.connector
2424
from snowflake.connector import DatabaseError, OperationalError, ProgrammingError
25+
from snowflake.connector.compat import IS_WINDOWS
2526
from snowflake.connector.connection import (
2627
DEFAULT_CLIENT_PREFETCH_THREADS,
2728
SnowflakeConnection,
@@ -747,7 +748,8 @@ def test_invalid_connection_parameters_turned_off(conn_cnx):
747748
) as conn:
748749
assert conn._autocommit == "True"
749750
assert conn._applucation == "this is a typo or my own variable"
750-
assert len(w) == 0
751+
# TODO: Windows tests will emit a warning about connections file privileges
752+
assert len(w) == (1 if IS_WINDOWS else 0)
751753

752754

753755
def test_invalid_connection_parameters_only_warns(conn_cnx):

0 commit comments

Comments
 (0)