Implement missing placeholder for st.dataframe#12968
Merged
lukasmasuch merged 14 commits intodevelopfrom Nov 11, 2025
Merged
Conversation
Contributor
✅ 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. |
Contributor
✅ PR preview is ready!
|
st.dataframest.dataframe
Contributor
There was a problem hiding this comment.
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
sfc-gh-bnisco
approved these changes
Nov 10, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.