Strange Exception "StreamlitAPIException"

I wrote code below. When I first run the script, it raise an StreamlitAPIException. Then I rerun streamlit, it dispear!

edited_df_types = st.data_editor(st.session_state.df_types.copy(),
                                             column_config={0: st.column_config.TextColumn('变量名'),
                                                            2: st.column_config.SelectboxColumn(
                                                                '修改后类型',
                                                                options=['object', 'int', 'float',
                                                                         'datetime'],
                                                                required=True
                                                            )},
                                             key='data_dtypes')

EVEN MORE STRANGE! I use try... except... to catch the exception and run st.rerun(), then the streamlit keep refreshing all the time.

I wonder what’s the difference between st.rerun() and click rerun in the browser page and why the StreamlitAPIException comes out and dispears later

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.