Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SnowflakeConnection.query() retries on errors that will never succeed #7637

Closed
3 of 4 tasks
sfc-gh-jcarroll opened this issue Oct 31, 2023 · 1 comment · Fixed by #7645
Closed
3 of 4 tasks

SnowflakeConnection.query() retries on errors that will never succeed #7637

sfc-gh-jcarroll opened this issue Oct 31, 2023 · 1 comment · Fixed by #7645
Assignees
Labels
feature:connections Related to st.experimental_connection and the st.connections module priority:P2 status:confirmed Bug has been confirmed by the Streamlit team type:bug Something isn't working

Comments

@sfc-gh-jcarroll
Copy link
Collaborator

Checklist

  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • I have provided sufficient information below to help reproduce this issue.

Summary

SnowflakeConnection.query() method is intended to refresh the connection and retry for errors that might be transient, such as due to a stale connection.

However the current behavior is to retry on any kind of snowflake.connector.Error including things like SQL syntax errors that will clearly never succeed

Reproducible Code Example

# conn_bug.py
import streamlit as st

conn = st.connection("snowflake")
# SQL syntax error that will never succeed
df = conn.query("SELECT sdgdsgdfds as HIGH_FIVES", ttl=0)
st.dataframe(df)

Steps To Reproduce

  1. streamlit run conn_bug.py
  2. Observe the app retrying the exception (multiple spinners and multiple stack traces printed

Expected Behavior

The app will attempt the above query once and then return an error

snowflake.connector.errors.ProgrammingError: 000904 (42000): SQL compilation error: error line 1 at position 7
invalid identifier 'SDGDSGDFDS'

Current Behavior

The app attempts the above query 3 times, showing the spinner 3 times and printing the exception stack trace 3 times

Is this a regression?

  • Yes, this used to work in a previous version.

Debug info

  • Streamlit version: 1.28
  • Python version: 3.11
  • Operating System: MacOS
  • Browser: Chrome

Additional Information

No response

@sfc-gh-jcarroll sfc-gh-jcarroll added type:bug Something isn't working status:needs-triage Has not been triaged by the Streamlit team labels Oct 31, 2023
@github-actions
Copy link

If this issue affects you, please react with a 👍 (thumbs up emoji) to the initial post.

Your feedback helps us prioritize which bugs to investigate and address first.

Visits

@vdonato vdonato self-assigned this Oct 31, 2023
@vdonato vdonato added priority:P2 feature:connections Related to st.experimental_connection and the st.connections module status:confirmed Bug has been confirmed by the Streamlit team and removed status:needs-triage Has not been triaged by the Streamlit team labels Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:connections Related to st.experimental_connection and the st.connections module priority:P2 status:confirmed Bug has been confirmed by the Streamlit team type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants