Skip to content

Conversation

@lukasmasuch
Copy link
Collaborator

@lukasmasuch lukasmasuch commented Nov 7, 2025

Describe your changes

Allows to customize the placeholder value used for missing values in dataframe cells in st.dataframe and st.data_editor.

GitHub Issue Link (if applicable)

Testing Plan

  • Added unit & e2e 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.

@snyk-io
Copy link
Contributor

snyk-io bot commented Nov 7, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

✅ PR preview is ready!

Name Link
📦 Wheel file https://core-previews.s3-us-west-2.amazonaws.com/pr-12968/streamlit-1.51.0-py3-none-any.whl
📦 @streamlit/component-v2-lib Download from artifacts
🕹️ Preview app pr-12968.streamlit.app (☁️ Deploy here if not accessible)

@lukasmasuch lukasmasuch changed the title Implement missing placeholder for st.dataframe [WIP] Implement missing placeholder for st.dataframe Nov 7, 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 Nov 8, 2025
@lukasmasuch lukasmasuch requested a review from Copilot November 8, 2025 11:12
Copy link
Contributor

Copilot AI left a 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 placeholder parameter to both st.dataframe and st.data_editor functions
  • 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

@lukasmasuch lukasmasuch marked this pull request as ready for review November 8, 2025 11:42
@lukasmasuch lukasmasuch requested a review from a team as a code owner November 8, 2025 11:42
@lukasmasuch lukasmasuch changed the title [WIP] Implement missing placeholder for st.dataframe Implement missing placeholder for st.dataframe Nov 8, 2025
@lukasmasuch lukasmasuch merged commit 490a62b into develop Nov 11, 2025
40 checks passed
@lukasmasuch lukasmasuch deleted the allow-configuring-missing-placeholder branch November 11, 2025 01:20
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.

Allow configuration of missing value placeholder in st.dataframe

3 participants