Summary
I am trying to allow users to edit data in a dataframe. The new data_editor works great, but for some reason the returned dataframe does not contain all the edits?
The edits are in the st.session_state, but not in the returned dataframe
Steps to reproduce
Code snippet:
import streamlit as st
import pandas as pd
test = [{"col0":"1",
"col1":"2",
"col2":"test",
"col3":"1"},
{"col0":"2",
"col1":"4",
"col2":"test2",
"col3":"2"}]
df = pd.DataFrame(test)
edited_df = st.data_editor(df,key = "test")
st.dataframe(edited_df)
st.write(st.session_state)
If I start editing col0, then only changes in col0 are returned in edited_df. Edits in col1, col2, and col3 are not captured in edited_df.
However, if I edit col1 first, then edits in col0, col2 and col3 are ignored
Expected behavior:
I would expect that all my edits are in the edited_df
Actual behavior:
If I start editing col0, then only changes in col0 are returned in edited_df. Edits in col1, col2, and col3 are not captured in edited_df.
However, if I edit col1 first, then edits in col0, col2 and col3 are ignored
Debug info
- Streamlit version: 1.26.0
- Python version: 3.9.0
- Using Idle
- OS version: Windows 10
- Browser version: 115.0.1901.203
Requirements file
Pure python - written in idle.