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
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.