snowflakedb / snowflake-connector-python

Snowflake Connector for Python
https://pypi.python.org/pypi/snowflake-connector-python/
Apache License 2.0
568 stars 456 forks source link

SNOW-1473500: Ability to interpolate variables within `config.toml` #1971

Open kameshsampath opened 3 weeks ago

kameshsampath commented 3 weeks ago

What is the current behavior?

Description

When the snow cli creates the config.toml it does not interpolate the variables within the attribute values except for ~.

e.g.

default_connection_name="cheatsheets"

[connections]
[connections.cheatsheets]
account = "account-id"
user = "kameshs"
warehouse = "COMPUTE_WH"
schema = "PUBLIC"
authenticator = "SNOWFLAKE_JWT"
private_key_path="$KEYS_DIR/.keys/rsa_key.p8"

The $KEYS_DIR never gets interpolated while reading the key path.

It will be nice to add variable interpolation support for all attribute values with in the config.toml.

Context

No response

What is the desired behavior?

Expecting the parsing on config.toml expands the variables as needed.

How would this improve snowflake-connector-python?

It will improve the DevX and helps in automation where the automation tools can define their set of ENV variables to be used.

References and other background

No response

sfc-gh-sghosh commented 3 weeks ago

Hello @kameshsampath ,

Thanks for raising the issue; we are checking and will update you.

Regards, Sujan

sfc-gh-sghosh commented 2 weeks ago

Hello @kameshsampath ,

Yes, At present SnowflakeCLI config.toml is not recognizing variables. Will update if there is any plan to support it. At present you have to use the directory ( KEYS_DIR) from the current user directory only

Example authenticator = "SNOWFLAKE_JWT" private_key_path="KEYS_DIR/rsa_key.p8"

Regards, Sujan

sfc-gh-sghosh commented 2 weeks ago

Hello @kameshsampath ,

At present, SnowflakeCLI config. tool doesn't support variables, so it will be taken as a feature request.

Regards, Sujan