-
Notifications
You must be signed in to change notification settings - Fork 4k
Implement missing placeholder for st.dataframe
#12968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
✅ PR preview is ready!
|
st.dataframest.dataframe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a placeholder parameter to st.dataframe and st.data_editor to allow users to customize the text displayed for missing values (such as None, NaN, etc.). The default value remains "None" to preserve backward compatibility.
Key Changes
- Added
placeholderparameter to bothst.dataframeandst.data_editorfunctions - Updated frontend rendering logic to use the custom placeholder text when displaying missing values
- Added comprehensive test coverage including Python unit tests and E2E snapshot tests
Reviewed Changes
Copilot reviewed 11 out of 20 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| proto/streamlit/proto/Arrow.proto | Added optional placeholder field to Arrow message for protobuf communication |
| lib/streamlit/elements/widgets/data_editor.py | Added placeholder parameter to data_editor function with docstring and proto marshalling |
| lib/streamlit/elements/arrow.py | Added placeholder parameter to dataframe function with docstring and proto marshalling |
| lib/tests/streamlit/elements/data_editor_test.py | Added unit tests verifying placeholder parameter behavior |
| lib/tests/streamlit/elements/arrow_dataframe_test.py | Added unit tests verifying placeholder parameter behavior |
| frontend/lib/src/components/widgets/DataFrame/hooks/useCustomRenderer.ts | Updated custom renderer to accept and use placeholder parameter |
| frontend/lib/src/components/widgets/DataFrame/DataFrame.tsx | Passed placeholder from element to useCustomRenderer hook |
| e2e_playwright/st_dataframe_config.py | Added E2E test case for placeholder functionality |
| e2e_playwright/st_dataframe_config_test.py | Updated test count and added snapshot assertion |
| e2e_playwright/st_data_editor_config.py | Added E2E test case for placeholder functionality |
| e2e_playwright/st_data_editor_config_test.py | Updated test count and added snapshot assertion |
| e2e_playwright/snapshots/* | Added snapshot images for visual regression testing |
Co-authored-by: Copilot <[email protected]>
…b.com/streamlit/streamlit into allow-configuring-missing-placeholder
Co-authored-by: Copilot <[email protected]>
…b.com/streamlit/streamlit into allow-configuring-missing-placeholder
st.dataframest.dataframe
Describe your changes
Allows to customize the placeholder value used for missing values in dataframe cells in
st.dataframeandst.data_editor.GitHub Issue Link (if applicable)
st.dataframe#7360Testing Plan
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.