datafold / data-diff

Compare tables within or across databases

Home Page:https://docs.datafold.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support dbt Snowflake connection using key file itself rather than just path to key file

will-warner opened this issue · comments

Is your feature request related to a problem? Please describe.
#792 enabled a Snowflake to connect using the key itself in addition to the previously allowed key path method.

dbt also supports connecting to Snowflake using the key itself as of 1.5, by providing private_key in your profile, ref.

The data-diff's dbt parser however has not been updated to parse this key from the dbt profile, meaning that you can only to connect to Snowflake via dbt using the key path method:

if credentials.get("private_key_path") is not None:
if credentials.get("password") is not None:
raise DataDiffDbtSnowflakeSetConnectionError("Cannot use password and key at the same time")
conn_info["key"] = credentials.get("private_key_path")
conn_info["private_key_passphrase"] = credentials.get("private_key_passphrase")

Describe the solution you'd like
Allow either the private_key_path or private_key to be parsed from the dbt profile.

Describe alternatives you've considered
NA

Additional context
Add any other context or screenshots about the feature request here.