Skip to content

Conversation

@lukasmasuch
Copy link
Collaborator

Describe your changes

The recent refactorings made it possible to use categorical index columns with st.data_editor. This PR removes the previous restrictions.

GitHub Issue Link (if applicable)

Testing Plan

  • Add e2e snapshot test and updated unit tests.

Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@lukasmasuch lukasmasuch changed the title Add support for categorical index to st.data_editor Add support for using categorical index with st.data_editor Jan 16, 2025
@lukasmasuch lukasmasuch added security-assessment-completed Security assessment has been completed for PR change:feature PR contains new feature or enhancement implementation impact:users PR changes affect end users labels Jan 16, 2025
Copy link
Collaborator

@raethlein raethlein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome 🚀
Was is the sum of changes or one particular change that enabled this?

@lukasmasuch
Copy link
Collaborator Author

lukasmasuch commented Jan 16, 2025

Was is the sum of changes or one particular change that enabled this?

The refactoring moved the parsing of categorical options to the parsing process and added those options to the column type info during quiver initialization, which makes these options accessible to index & data columns. The previous implementation extracted the options after quiver initialization, and that didn't had access to the required props anymore to get this for index columns.

@lukasmasuch lukasmasuch merged commit d942545 into develop Jan 16, 2025
33 checks passed
@lukasmasuch lukasmasuch deleted the feature/add-support-for-categorical-index branch January 16, 2025 16:23
edegp pushed a commit to edegp/streamlit that referenced this pull request Jan 19, 2025
…lit#10195)

## Describe your changes

The recent refactorings made it possible to use categorical index
columns with `st.data_editor`. This PR removes the previous
restrictions.

## GitHub Issue Link (if applicable)

- Closes streamlit#9647

## Testing Plan

- Add e2e snapshot test and updated unit tests.

---

**Contribution License Agreement**

By submitting this pull request you agree that all contributions to this
project are made under the Apache 2.0 license.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:feature PR contains new feature or enhancement implementation impact:users PR changes affect end users security-assessment-completed Security assessment has been completed for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

st.dataframe does not show pd.Categorical indices properly

3 participants