Streamlit st.data_editor Error in Cell Creation

ISSUE: The st.data_editor returns an error when num_rows is set to “dynamic”:

Error during cell creation.

This should never happen. Please report this bug. 
Error: Error: Row index is out of range: 4

To recreate the error, just visit the documentation page for editor and try adding a new row: st.data_editor - Streamlit Docs

My browser is Opera GX if that info is needed. Win10 64bit and I use streamlit cloud

Hi @Shiro,

Thanks for sharing this question.

Is this the code snippet you’re using?

import streamlit as st
import pandas as pd

df = pd.DataFrame(
       {"command": "st.selectbox", "rating": 4, "is_widget": True},
       {"command": "st.balloons", "rating": 5, "is_widget": False},
       {"command": "st.time_input", "rating": 3, "is_widget": True},
edited_df = st.data_editor(df, num_rows="dynamic")

favorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]
st.markdown(f"Your favorite command is **{favorite_command}** 🎈")

I wasn’t able to reproduce this error using this code snippet or the embedded app in the docs (I’ve deployed the app here to try to reproduce). I also downloaded Opera GX and unfortunately wasn’t able to reproduce it with that browser, either.

Does this happen every time you try adding a new row, or only intermittently?