question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upgrade snowflake-connector-python version to support the token cache

See original GitHub issue

Describe the feature

Upgrade snowflake-connector-python to >= v2.2.3 to support the Snowflake OAuth token cache. The only docs we could find on this were from the odbc connector, but the snowflake-connector-python says that… something… changed around a “Secure SSO ID Token” in v2.2.3 and the diff appears to be relevant to some sort of token cache.

We should:

  • Try out enabling the token cache in our Snowflake account
  • See if it works with the current version of snowflake-connector-python that dbt supports
  • If not, see if it magically works with v2.2.3
  • If not, see if we can find someone at Snowflake to give us the scoop on supported versions 😃

Additional context

The token cache makes web-based oauth usable in dbt. Without the cache, each new connection (ie. thread) opened by dbt requires the user to login via a browser, rendering browser-based oauth basically useless in a multithreaded dbt run.

Who will this benefit?

Snowflake users using the oauth connection method

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
don-at-omazecommented, Oct 26, 2020

Hello everyone. I’ve updated to the latest version and still see this issue. Any pointers on how to resolve?

1reaction
ryano144commented, Jul 27, 2020

I was getting sufficiently annoyed by the multiple popups and was able to test this out recently. Here are the steps I took:

  1. Updated the allow_id_token parameter on our Snowflake account to true
  2. Installed the keyring dependency that the Snowflake Python Connector uses for credentials caching.
  3. Ran DBT 0.17.0 with 2 threads and still got 3 login prompts
  4. Setup a local version of DBT to run from source in a Virtual Environment
  5. Updated the version of Snowflake Python Connector to snowflake-connector-python==2.2.3
  6. Ran local DBT 0.18.0-b1 with 2 threads. Only got a single log in prompt.
  7. Ran it again. Did not get a login prompt at all!
  8. Verified that the prior steps also work with the latest snowflake connector (2.2.9)

I’m working on verifying whether I’m allowed to sign the CLA before sending a PR (the change is very simple).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrade snowflake-connector-python version to support the ...
The token cache makes web-based oauth usable in dbt. Without the cache, each new connection (ie. thread) opened by dbt requires the user...
Read more >
Installing the Python Connector - Snowflake Documentation
This topic provides instructions for installing the Snowflake Connector for Python. The connector can currently be installed in Linux, macOS, and Windows ...
Read more >
snowflake-connector-python - PyPI
Upgraded Pyarrow version from 3.0 to 5.0. Internal change to the implementation for PUT and GET. A new connection parameter use_new_put_get was added...
Read more >
cache passcode for python snowflake connector
Python Connector - Using Multi-Factor Authentication (MFA). Snowflake supports caching MFA tokens, including combining MFA token caching ...
Read more >
Snowflake — Dataiku DSS 11 documentation
Connection setup (Dataiku Custom or Dataiku Cloud Stacks)¶ · Fill in the settings of the connection using your Snowflake information. · (Optional but...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found