â ã¯ããã«
https://dk521123.hatenablog.com/entry/2024/12/11/212315
ã§ã触ããããStreamlit in Snowflake ã触ã£ã¦ã¿ãã
ç®æ¬¡
ãï¼ãStreamlit in Snowflake ãï¼ãç¨é ãï¼ã使ç¨ä¸ã®æ³¨æ ãï¼ï¼æ¥ç¶ãã¢ã¯ãã£ãã ã¨ãã®åã ããéãããã ãï¼ï¼æ©è½å¶éãã ãï¼ãHello world
ãï¼ãStreamlit in Snowflake
* Snowflake ã«é¢ããã¢ããªãPythonã³ã¼ãã§ã ãã¤ã³ãã©è¨å®ãªãã«ç°¡åã«ä½æã§ãã
https://docs.snowflake.com/ja/developer-guide/streamlit/about-streamlit
ãï¼ãç¨é
ä¾ãã°ããã * ã¦ã¼ã¶ç®¡çããéç¨ãã¼ã« ãªã©ãªã© ã¡ãã£ã¨ããããã¼ã«ãä½ããã
ãï¼ã使ç¨ä¸ã®æ³¨æ
ï¼ï¼æ¥ç¶ãã¢ã¯ãã£ãã ã¨ãã®åã ããéãããã
* æ¥ç¶ãã¢ã¯ãã£ãã§ããéã¯ã¦ã§ã¢ãã¦ã¹ãã¢ã¯ãã£ãã®ã¾ã¾ã«ãªãããã ãã¦ã§ã¢ãã¦ã¹ã稼åããæéã§ã¯ã¬ã¸ããå ç®ããã¦ãã => è¦ããã«éæãã
ï¼ï¼æ©è½å¶éãã
* 詳ããã¯ã以ä¸ã®å ¬å¼ããã¥ã¡ã³ãã«è¨è¼
https://docs.snowflake.com/ja/developer-guide/streamlit/limitations
ãï¼ãHello world
https://docs.snowflake.com/ja/developer-guide/streamlit/create-streamlit-ui
[1] Snowflake ã® Web UIã«ãã°ã¤ã³ãã [2] å³ãã¤ã³ã® [Project]-[Streamlit]ãé¸æ [3] [+Steamlit App]ãã¿ã³æ¼ä¸ [4] 以ä¸ãå ¥åãããCreateããã¿ã³æ¼ä¸ * App title: ä»»æï¼ããã§ã¯ãHello worldãï¼ * App locationï¼ä½¿ç¨ãããDBã¨Schemaãé¸æ * App warehouseï¼ä½¿ç¨ãããã¦ã§ã¢ãã¦ã¹ ãï¼ç°¡åãªãã¢ããªãªããµã¤ãºã¯è»½ãã®æ¹ãããï¼ => èµ·åã¾ã§ãã°ãå¾ ã¤ => åæã«ãµã³ãã«ãã§ãã
ãµã³ãã«
https://docs.snowflake.com/ja/developer-guide/streamlit/example-single-page
# Import python packages import streamlit as st from snowflake.snowpark.context import get_active_session # Write directly to the app st.title("Example Streamlit App :balloon:") st.write( """Replace this example with your own code! **And if you're new to Streamlit,** view our easy-to-follow guides at [docs.streamlit.io](https://docs.streamlit.io). """ ) # Get the current credentials session = get_active_session() # Use an interactive slider to get user input hifives_val = st.slider( "Number of high-fives in Q3", min_value=0, max_value=90, value=60, help="Use this to enter the number of high-fives you gave in Q3", ) # Create an example dataframe # Note: this is just some dummy data, but you can easily connect to your Snowflake data # It is also possible to query data using raw SQL using session.sql() e.g. session.sql("select * from table") created_dataframe = session.create_dataframe( [[50, 25, "Q1"], [20, 35, "Q2"], [hifives_val, 30, "Q3"]], schema=["HIGH_FIVES", "FIST_BUMPS", "QUARTER"], ) # Execute the query and convert it into a Pandas dataframe queried_data = created_dataframe.to_pandas() # Create a simple bar chart # See docs.streamlit.io for more types of charts st.subheader("Number of high-fives") st.bar_chart(data=queried_data, x="QUARTER", y="HIGH_FIVES") st.subheader("Underlying data") st.dataframe(queried_data, use_container_width=True)
åèæç®
https://ex-ture.com/blog/2024/08/15/create_sis_app/
é¢é£è¨äº
streamlit ï½ å
¥éç·¨ ï½
https://dk521123.hatenablog.com/entry/2024/12/11/212315