Reputation: 1223
I'm working on developing an app using Streamlit where users can upload a CSV file and insert it into a table or display its contents . I've attempted to use st.file_uploader, but it seems to be disabled. In my use case, users should have the option to upload a CSV file either from their local machine or from my S3 bucket. Could you please provide alternative approaches to implement this functionality?
Thanks
Upvotes: 2
Views: 2113
Reputation: 176064
Streamlit in Snowflake(version 9.2) supports st.file_uploader
component.
import streamlit as st
from snowflake.snowpark.context import get_active_session
session = get_active_session()
st.text("Current version:"+session.sql('select current_version()').collect()[0][0])
uploaded_file = st.file_uploader("Choose a file")
Output:
More at: Support for st.file_uploader - Preview
Upvotes: 1
Reputation: 1
You can build the Streamlit app running in snowflake container services and achieve the same
Upvotes: 0
Reputation: 2069
To be precise, the Streamlit file_uploader control works correctly in applications outside Snowflake. For now it is blocked in Streamlit in Snowflake (SiS) for security reasons, in the future Snowflake should enable it (I'm also waiting very much for that).
You can find the full list of limitations in SiS here: Unsupported Streamlit in Snowflake features
At the moment there are two possibilities:
Upvotes: 1