-
Notifications
You must be signed in to change notification settings - Fork 4k
Labels
feature:st.column_configRelated to column configuration functionalityRelated to column configuration functionalityfeature:st.data_editorRelated to the `st.data_editor` widgetRelated to the `st.data_editor` widgetpriority:P2Medium-high priority - fix within one monthMedium-high priority - fix within one monthstatus:confirmedBug has been confirmed by the Streamlit teamBug has been confirmed by the Streamlit teamtype:bugSomething isn't working as expectedSomething isn't working as expected
Description
Checklist
- I have searched the existing issues for similar issues.
- I added a very descriptive title to this issue.
- I have provided sufficient information below to help reproduce this issue.
Summary
When using st.data_editor configured with a Multiselect column (column config → st.column_config.MultiselectColumn) and the data editor is dynamic and contains other columns, adding a new row that sets the multiselect column causes Streamlit to raise a ValueError
Reproducible Code Example
import pandas as pd
import streamlit as st
data_df = pd.DataFrame(
{
"category": [
["exploration", "visualization"],
["llm", "visualization"],
["exploration"],
],
"is_active": [True, True, True],
}
)
st.data_editor(
data_df,
hide_index=True,
num_rows="dynamic",
key="data_editor_key",
column_config={
"category": st.column_config.MultiselectColumn(
"App Categories",
help="The categories of the app",
options=[
"exploration",
"visualization",
"llm",
],
color=["#ffa421", "#803df5", "#00c0f2"],
format_func=lambda x: x.capitalize(),
),
"is_active":st.column_config.CheckboxColumn(
"Active",
help="Tick to include this app in the analysis.",
default=True,
required=True,
)
},
)Steps To Reproduce
- Add a row to the data_editor
- Select at least one option from the multi select in
App Categories
Expected Behavior
Add New row to the data editor with the selected values in the App Categories column
Current Behavior
Error Message:
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.
Is this a regression?
- Yes, this used to work in a previous version.
Debug info
- Streamlit version: 1.50.0
- Python version: 3.11.13
- Operating System: MacOs 15.5
- Browser: Chrome
Additional Information
No response
github-actions, VladNSoltuz and wbukowski
Metadata
Metadata
Assignees
Labels
feature:st.column_configRelated to column configuration functionalityRelated to column configuration functionalityfeature:st.data_editorRelated to the `st.data_editor` widgetRelated to the `st.data_editor` widgetpriority:P2Medium-high priority - fix within one monthMedium-high priority - fix within one monthstatus:confirmedBug has been confirmed by the Streamlit teamBug has been confirmed by the Streamlit teamtype:bugSomething isn't working as expectedSomething isn't working as expected