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

bump requirements, enable the token cache #2698

Merged
merged 2 commits into from
Aug 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
- `adapter_macro` is no longer a macro, instead it is a builtin context method. Any custom macros that intercepted it by going through `context['dbt']` will need to instead access it via `context['builtins']` ([#2302](https://github.com/fishtown-analytics/dbt/issues/2302), [#2673](https://github.com/fishtown-analytics/dbt/pull/2673))
- `adapter_macro` is now deprecated. Use `adapter.dispatch` instead.


### Under the hood
- Upgraded snowflake-connector-python dependency to 2.2.10 and enabled the SSO token cache ([#2613](https://github.com/fishtown-analytics/dbt/issues/2613), [#2689](https://github.com/fishtown-analytics/dbt/issues/2689), [#2698](https://github.com/fishtown-analytics/dbt/pull/2698))

### Features
- Added a `dispatch` method to the context adapter and deprecated `adapter_macro`. ([#2302](https://github.com/fishtown-analytics/dbt/issues/2302), [#2679](https://github.com/fishtown-analytics/dbt/pull/2679))
- The built-in schema tests now use `adapter.dispatch`, so they can be overridden for adapter plugins ([#2415](https://github.com/fishtown-analytics/dbt/issues/2415), [#2684](https://github.com/fishtown-analytics/dbt/pull/2684))
Expand Down
6 changes: 3 additions & 3 deletions core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ def read(fname):
'logbook>=1.5,<1.6',
'typing-extensions>=3.7.4,<3.8',
# the following are all to match snowflake-connector-python
'requests>=2.18.0,<2.23.0',
'idna<2.9',
'cffi>=1.9,<1.14',
'requests>=2.18.0,<2.24.0',
'idna<2.10',
'cffi>=1.9,<1.15',
],
zip_safe=False,
classifiers=[
Expand Down
2 changes: 2 additions & 0 deletions plugins/snowflake/dbt/adapters/snowflake/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ def auth_args(self):
)

result['token'] = token
# enable the token cache
result['client_store_temporary_credential'] = True
result['private_key'] = self._get_private_key()
return result

Expand Down
4 changes: 2 additions & 2 deletions plugins/snowflake/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
},
install_requires=[
'dbt-core=={}'.format(package_version),
'snowflake-connector-python==2.2.1',
'snowflake-connector-python==2.2.10',
'azure-common<2.0.0',
'azure-storage-blob<12.0.0',
'azure-storage-blob>=12.0.0,<13.0.0',
'urllib3>=1.20,<1.26.0',
# this seems sufficiently broad
'cryptography>=2,<3',
Expand Down
6 changes: 3 additions & 3 deletions test/unit/test_snowflake_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def test_authenticator_user_pass_authentication(self):
password='test_password', role=None, schema='public',
user='test_user', warehouse='test_warehouse',
authenticator='test_sso_url', private_key=None,
application='dbt')
application='dbt', client_store_temporary_credential=True)
])

def test_authenticator_externalbrowser_authentication(self):
Expand All @@ -320,7 +320,7 @@ def test_authenticator_externalbrowser_authentication(self):
client_session_keep_alive=False, database='test_database',
role=None, schema='public', user='test_user',
warehouse='test_warehouse', authenticator='externalbrowser',
private_key=None, application='dbt')
private_key=None, application='dbt', client_store_temporary_credential=True)
])

def test_authenticator_oauth_authentication(self):
Expand All @@ -339,7 +339,7 @@ def test_authenticator_oauth_authentication(self):
client_session_keep_alive=False, database='test_database',
role=None, schema='public', user='test_user',
warehouse='test_warehouse', authenticator='oauth', token='my-oauth-token',
private_key=None, application='dbt')
private_key=None, application='dbt', client_store_temporary_credential=True)
])

@mock.patch('dbt.adapters.snowflake.SnowflakeCredentials._get_private_key', return_value='test_key')
Expand Down