-
Notifications
You must be signed in to change notification settings - Fork 265
Description
Describe the bug
schemachange
ignores session_parameters
defined in connections.toml
.
In SnowflakeSession.py
, schemachange constructs its own session_parameters = {"QUERY_TAG": ...}
and passes that into snowflake.connector.connect(...)
, which overwrites any session_parameters
from the TOML connection (e.g., QUOTED_IDENTIFIERS_IGNORE_CASE=false
).
As a result, users cannot control session-level behavior via connections.toml
.
To Reproduce
- Create a
connections.toml
with a named connection (matching--connection-name
) that includessession_parameters
:[STG] account = "xxx" user = "xxx" authenticator = "externalbrowser" role = "STG_ROLE" warehouse = "STG_WH" database = "DB_STG" schema = "ADM" session_parameters = { QUOTED_IDENTIFIERS_IGNORE_CASE = false }
- Run schemachange using that connection:
schemachange --connections-file-path ./connections.toml --connection-name STG --config-folder ./_INFRA/configs --config-file-name schemachange-config.yml
- During the same run (e.g., via a small script or interactive session), check the parameter:
Actual: value remains
SHOW PARAMETERS LIKE 'QUOTED_IDENTIFIERS_IGNORE_CASE' IN SESSION;
TRUE
(or the user/account default), notfalse
from TOML.
Expected behavior
schemachange
should respect session_parameters
provided via connections.toml
.
If schemachange needs to set QUERY_TAG
, it should merge its tag into user-supplied session_parameters
rather than overwrite them. Alternatively, avoid passing session_parameters
to connect(...)
and set QUERY_TAG
post-connect via ALTER SESSION
.
Screenshots

Schemachange (please complete the following information):
- Version (e.g., 3.5.3): 4.0.1
Additional context
-
Root cause:
SnowflakeSession
buildsself.session_parameters = {"QUERY_TAG": ...}
and passes it tosnowflake.connector.connect(...)
, eclipsing TOML-definedsession_parameters
. -
Proposed fixes:
- Merge TOML
session_parameters
with schemachange’sQUERY_TAG
before connecting. - Do not pass
session_parameters
at connect time; keep usingALTER SESSION SET QUERY_TAG
so the connector can apply TOML session parameters as intended.
- Merge TOML