-
Notifications
You must be signed in to change notification settings - Fork 12
Add further handling of key auth in Snowflake #33
Conversation
|
Looks like without dbt, I have a local commit waiting for this PR which renames DBT's |
definitely agree here. What's unfortunate is this would introduce a breaking change for anyone currently using @williebsweet interested in your thoughts here. This is a good long term change, but some users who are using the data-diff python api or --conf .toml file would need to change how they are designating a key for snowflake (they would just need to pass in |
Co-authored-by: Dan Lawin <daniellawin@gmail.com>
|
Hi @williebsweet! Hoping to hear an update from you! We are excited to evaluate data-diff and require this change to be made in order to do that :) |
@jakedave Thanks for bringing this back to my attention. I'm working with Dan on a comms strategy for the breaking change so it might take a bit to get this merged and released. To get your evaluation underway - have you tried pip installing the branch that you introduced the changes on? While it's not ideal, you'd at least get to try out the changes that you've made. |
|
Thanks for the reply! Yes; to be clear, it's a blocker to evaluation beyond my current local environment (I.e. wider team adoption). Happy to hear that conversations are ongoing and looking forward to hearing more |
| encryption_algorithm=serialization.NoEncryption(), | ||
| ) | ||
|
|
||
| if "key" in kw or "key_path" in kw: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @jakedave I'm just realizing that dbt only supports a private_key_path, there's no need to add any support for a string
Are you able to rework this with the previous assumption? kw.get("key") <--- path
We shouldn't stray from what is defined here https://docs.getdbt.com/reference/warehouse-setups/snowflake-setup#key-pair-authentication
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once that's done we can release a new sqeleton version, add the new sqeleton version in the data-diff PR, and remove this method there
@staticmethod
def _get_snowflake_private_key(credentials):
|
Hey Jake, we want to get this in the next release (soon) so I ran with a few PRs of my own: Appreciate your contributions here! |
Relating to @dlawin ask to move code from this PR downstream as to increase DRY-ness
Using
poetry run python3 -m data_diff --dbtwith a password (incorrect due to our org's restriction on un/pw) from aprofile.ymlresults in:running the same command while specifying a
private_key_pathandprivate_key_passphraseresults in[13:18:29] ERROR - Bad decrypt. Incorrect password?or, with correct key auth:
[15:07:12] ERROR - 002003 (02000): SQL compilation error: Database 'XXX' does not exist or not authorized.indicating successful authentication