I’m trying to connect my streamlit application with some sql database that Snowflake owns. Clearly I have problems entering the data… can you help me?
The error is “ForbiddenError: 250001 (08001): Failed to connect to DB. Verify the account name is correct: ltb39995.snowflakecomputing.com:443. 000403: HTTP 403: Forbidden”
(bug to find the url?)
import streamlit as st
#import snowflake.connector as sf
import pandas as pd
# Initialize connection with experimental connection
conn = st.experimental_connection('snowpark')
# Read database
df = conn.query('select * from DATA.DEFAULT_PROBABILITY;', ttl=600)
# View results.
for row in df.itertuples():
st.write(pd.DataFrame(df))
I was looking for and applying various ways to make the connection work, but I can’t find the reason for the failure. I cant find error
Thanks for your question. It seems in your secrets.toml you’ve specified COMPUTE_SH as the warehouse name, but from the screenshot it is COMPUTE_WH
In the last line of the code, could you try printing out values from the rows (currently you’ve specified df). Please refer to the Streamlit Docs for example (e.g. st.write(f"{row.NAME} has a :{row.PET}:") where NAME and PET are column names, thus please replace these with column names from your database.)
Hello Chanin! It is a great pleasure to know that you answered me Thanks for sharing the typo, but it continues with the same error… although now it tells me that it is an account problem. In Snowflake, do I have to put something somewhere so that it can read the SQL from outside? Thank you!
Error: ForbiddenError: 250001 (08001): Failed to connect to DB. Verify the account name is correct: ltb39995.snowflakecomputing.com:443. 000403: HTTP 403: Forbidden