cancel
Showing results for 
Search instead for 
Did you mean: 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results for 
Search instead for 
Did you mean: 

connection from databricks to snowflake using OKTA

ymt
New Contributor II

Hi team,

This is how I connect to Snowflake from Jupyter Notebook:

import snowflake.connector

snowflake_connection = snowflake.connector.connect(
    authenticator='externalbrowser',
    user='U1',
    account='company1.us-east-1',
    database='db1',
    schema='s1',
    warehouse='WH1'
)

cur = snowflake_connection.cursor()

cur.execute("select col1 from tab1;")

(it redirects me to SSO / OKTA auth page and then works fine)

This is what I get when I try to do the same in my Databricks Notebook:

ImportError: cannot import name 'NamedTuple' from 'typing_extensions' (/databricks/python/lib/python3.9/site-packages/typing_extensions.py)

The error happens on my "snowflake_connection = snowflake.connector.connect" line.

Wait, what?

Ok, this is how I tried to solve it using the very first cell in my Databricks Notebook:

%sh
pip install --upgrade pip
pip install snowflake-connector-python
pip install --upgrade typing_extensions

It worked without error, but didn't actually help.

I've seen other topics regarding Databricks to Snowflake connection here, they suggest to use secrets with Snowflake username / password pair, but I don't have any Snowflake password, I authenticate using SSO / OKTA.

Please advise.

0 REPLIES 0

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group