From d224f047042e1f73af4505e0f743e1330d60575d Mon Sep 17 00:00:00 2001 From: ehpersonal38 <103586016+ehpersonal38@users.noreply.github.com> Date: Fri, 19 May 2023 19:46:15 -0400 Subject: [PATCH] make species stats up to 70% faster --- scripts/plotly_streamlit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/plotly_streamlit.py b/scripts/plotly_streamlit.py index c173e1f5a..282f63cb5 100755 --- a/scripts/plotly_streamlit.py +++ b/scripts/plotly_streamlit.py @@ -45,7 +45,8 @@ def get_connection(path: str): return sqlite3.connect(path, check_same_thread=False) -def get_data(conn: Connection): +@st.cache_data() +def get_data(_conn: Connection): df1 = pd.read_sql("SELECT * FROM detections", con=conn) return df1