I'm working on a Snowpark project using the Python API. My Snowflake account requires SSO, so I've used the SSO method to get connected, but I'm having issues with there being no defined session. How do I fix this so that I can start working with this data?
My SSO code:
import snowflake.connector
import sys
con = snowflake.connector.connect(
user=<"username">,
account=<account name">,
authenticator="externalbrowser",
)
cur = con.cursor()
print(sys.executable)
print(sys.version)
print(sys.version_info)
try:
cur.execute("select current_date")
one_row=cur.fetchone()
print("Current_Date:",one_row[0])
cur.execute("SELECT current_version()")
one_row = cur.fetchone()
print("Snowfalke_Version:",one_row[0])
finally:
cur.close()
cur.close()
First query run:
provider_table= session.table("ENVIRONMENT.<view name>")
And I get this error: NameError: name 'session' is not defined
I admit that I know that I don't define "session" prior to calling it -- I'm just not sure of the method to do so. Anyone know? Thanks!