st.data_editor is not stateful when styling disabled columns #6898
Labels
feature:st.data_editor
priority:P2
status:confirmed
Bug has been confirmed by the Streamlit team
type:bug
Something isn't working
Checklist
Summary
This is a bug reported in the forum. The underlying issue is how the data editor determines equivalency of pandas stylers.
If you have a dataframe with two columns (A and B) with column B both styled and disabled, the data editor will correctly show the styled column B and editable column A. However, the widget will not be stateful unless the styler object passed to it is coming from session state. It needs to be identically the same object in memory for the data editor to be stateful. Redefining the same styler element will be viewed as "different" and cause the data editor to be recreated from scratch.
Thanks to DGR from the forum for an executable code snippet. I've modified it here to highlight the issue:
Reproducible Code Example
Steps To Reproduce
Expected Behavior
Two equivalently defined styler objects should be viewed as "the same" for the purposes of the widget reconnecting to an instance on the front end. The data editor should be stateful.
Current Behavior
The data editor is not stateful when passed equivalent styler objects between reruns; it requires identical pointers to the same styler object.
Is this a regression?
Debug info
Additional Information
@LukasMasuch
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: