I’m not sure what is happening. I’m getting an AssertionError when calling streamlit run main.py
My script basically connects to Snowflake, queries tables into Pandas dataframes, and then calls st.write(df)
. I’ve also tried st.table(df)
.
Logs:
2022-08-23 11:39:11.567 Exception in callback AppSession._on_scriptrunner_event.<locals>.<lambda>() at c:\users\michael kleban\appdata\local\programs\python\python39\lib\site-packages\streamlit\runtime\app_session.py:400
handle: <Handle AppSession._on_scriptrunner_event.<locals>.<lambda>() at c:\users\michael kleban\appdata\local\programs\python\python39\lib\site-packages\streamlit\runtime\app_session.py:400>
Traceback (most recent call last):
File "c:\users\michael kleban\appdata\local\programs\python\python39\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "c:\users\michael kleban\appdata\local\programs\python\python39\lib\site-packages\streamlit\runtime\app_session.py", line 400, in <lambda>
lambda: self._handle_scriptrunner_event_on_main_thread(
File "c:\users\michael kleban\appdata\local\programs\python\python39\lib\site-packages\streamlit\runtime\app_session.py", line 400, in <lambda> lambda: self._handle_scriptrunner_event_on_main_thread(
File "c:\users\michael kleban\appdata\local\programs\python\python39\lib\site-packages\streamlit\runtime\app_session.py", line 445, in _handle_scriptrunner_event_on_main_thread
assert (AssertionError: This function must only be called on the main thread
2022-08-23 11:39:11.570 Exception in callback AppSession._on_scriptrunner_event.<locals>.<lambda>() at c:\users\michael kleban\appdata\local\programs\python\python39\lib\site-packages\streamlit\runtime\app_session.py:400
handle: <Handle AppSession._on_scriptrunner_event.<locals>.<lambda>() at c:\users\michael kleban\appdata\local\programs\python\python39\lib\site-packages\streamlit\runtime\app_session.py:400>
Traceback (most recent call last):
File "c:\users\michael kleban\appdata\local\programs\python\python39\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "c:\users\michael kleban\appdata\local\programs\python\python39\lib\site-packages\streamlit\runtime\app_session.py", line 400, in <lambda> lambda: self._handle_scriptrunner_event_on_main_thread(
File "c:\users\michael kleban\appdata\local\programs\python\python39\lib\site-packages\streamlit\runtime\app_session.py", line 445, in _handle_scriptrunner_event_on_main_thread
assert (AssertionError: This function must only be called on the main thread