<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic connection from databricks to snowflake using OKTA in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/connection-from-databricks-to-snowflake-using-okta/m-p/67861#M2961</link>
    <description>&lt;P&gt;Hi team,&lt;/P&gt;&lt;P&gt;This is how I connect to Snowflake from Jupyter Notebook:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;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;")&lt;/LI-CODE&gt;&lt;P&gt;(it redirects me to SSO / OKTA auth page and then works fine)&lt;/P&gt;&lt;P&gt;This is what I get when I try to do the same in my Databricks Notebook:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;ImportError: cannot import name 'NamedTuple' from 'typing_extensions' (/databricks/python/lib/python3.9/site-packages/typing_extensions.py)&lt;/LI-CODE&gt;&lt;P&gt;The error happens on my &lt;EM&gt;"snowflake_connection = snowflake.connector.connect"&lt;/EM&gt; line.&lt;/P&gt;&lt;P&gt;Wait, what?&lt;/P&gt;&lt;P&gt;Ok, this is how I tried to solve it using the very first cell in my Databricks Notebook:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;%sh
pip install --upgrade pip
pip install snowflake-connector-python
pip install --upgrade typing_extensions&lt;/LI-CODE&gt;&lt;P&gt;It worked without error, but didn't actually help.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;Please advise.&lt;/P&gt;</description>
    <pubDate>Wed, 01 May 2024 22:11:51 GMT</pubDate>
    <dc:creator>ymt</dc:creator>
    <dc:date>2024-05-01T22:11:51Z</dc:date>
    <item>
      <title>connection from databricks to snowflake using OKTA</title>
      <link>https://community.databricks.com/t5/get-started-discussions/connection-from-databricks-to-snowflake-using-okta/m-p/67861#M2961</link>
      <description>&lt;P&gt;Hi team,&lt;/P&gt;&lt;P&gt;This is how I connect to Snowflake from Jupyter Notebook:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;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;")&lt;/LI-CODE&gt;&lt;P&gt;(it redirects me to SSO / OKTA auth page and then works fine)&lt;/P&gt;&lt;P&gt;This is what I get when I try to do the same in my Databricks Notebook:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;ImportError: cannot import name 'NamedTuple' from 'typing_extensions' (/databricks/python/lib/python3.9/site-packages/typing_extensions.py)&lt;/LI-CODE&gt;&lt;P&gt;The error happens on my &lt;EM&gt;"snowflake_connection = snowflake.connector.connect"&lt;/EM&gt; line.&lt;/P&gt;&lt;P&gt;Wait, what?&lt;/P&gt;&lt;P&gt;Ok, this is how I tried to solve it using the very first cell in my Databricks Notebook:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;%sh
pip install --upgrade pip
pip install snowflake-connector-python
pip install --upgrade typing_extensions&lt;/LI-CODE&gt;&lt;P&gt;It worked without error, but didn't actually help.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;Please advise.&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2024 22:11:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/connection-from-databricks-to-snowflake-using-okta/m-p/67861#M2961</guid>
      <dc:creator>ymt</dc:creator>
      <dc:date>2024-05-01T22:11:51Z</dc:date>
    </item>
  </channel>
</rss>

