Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create Snowflake connection file via connections add if we specify config_args attribute #1401

Open
nj1973 opened this issue Jan 16, 2025 · 0 comments · May be fixed by #1431
Open
Assignees
Labels
type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@nj1973
Copy link
Contributor

nj1973 commented Jan 16, 2025

If I try to add a Snowflake connection with connect-args attribute it fails:

data-validation connections add -c snowflake_p8 Snowflake \
 --user=dvtuserp8 --password="" \
 --account="my-acc" \
 --database="my-db" \
 --connect-args='{"private_key_file": "/home/nobody/dvt/snowflake/rsa_key.p8", "private_key_file_pwd": "my-pass"}'
...
 in do_connect
    connect_args.setdefault("converter_class", _SnowFlakeConverter)
    ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'setdefault'

The problem is that --connect-args remains a string value and is not converted to a dict.

We need to cater for this in cli_tools.get_connection_config_from_args(). If we manually create the connection file then things work from there on.

While fixing the issue we should probably add some help to the connections doc regarding connecting to Snowflake using a key file.

@helensilva14 helensilva14 changed the title Unable to create Snowflake connection file via connections add if we specify config_args attribute Unable to create Snowflake connection file via connections add if we specify config_args attribute Jan 16, 2025
@helensilva14 helensilva14 added the type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. label Jan 17, 2025
@nj1973 nj1973 self-assigned this Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
2 participants