0

I have been trying to do a DB validating on Snowflake. But Cannot find the proper keywords to connect. I have installed snowflake-connector. But not able to get the script. I have tried below code and imported snowflake library too at Project and Suit levels/

    ctx_QAT_ONEWM_UIPARAMS = snowflake.connector.connect(
    user='****', # enter userID here
    password='****', # Enter Password here
    account='*****',
    warehouse='******',
    database='*****',
    schema='****',
    role= '*****',
    authenticator='externalbrowser',
    )
    cs_QAT_ONEWM_UIPARAMS = ctx_QAT_ONEWM_UIPARAMS.cursor()
    print("DB Session Started")
    try:
    cs_QAT_ONEWM_UIPARAMS.execute("SELECT current_version()")
    one_row = cs_QAT_ONEWM_UIPARAMS.fetchone()
    print(one_row[0])
    finally:
    cs.close()
    ctx.close()
Surabhi
  • 53
  • 1
  • 10

1 Answers1

0

I am able to connect using an externalbrowser authentication with two differences:

  • using dbname instead of database
  • excluding the password. It is not needed when using externalbrowser if the browser stores it

Alternatively, I'm able to connect using a system user with a private key with a password as the private_key parameter, using the default authenticator

Stephan Eggermont
  • 15,847
  • 1
  • 38
  • 65