Skip to content

Set add_rows deprecation warning to show in browser#13628

Merged
lukasmasuch merged 11 commits intodevelopfrom
lukasmasuch/add-rows-warning
Jan 27, 2026
Merged

Set add_rows deprecation warning to show in browser#13628
lukasmasuch merged 11 commits intodevelopfrom
lukasmasuch/add-rows-warning

Conversation

@lukasmasuch
Copy link
Copy Markdown
Collaborator

Describe your changes

Enable the add_rows deprecation warning to be displayed in the browser by setting show_in_browser=True. This ensures users see the deprecation notice in the Streamlit frontend, making them aware that the feature may be removed in the future.

Testing Plan

  • Updated the unit test to verify show_in_browser=True is set
  • Added an E2E test to confirm the deprecation warning appears in the browser (10 instances for the 10 add_rows calls in the test app)

Contribution License Agreement

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

Enable the deprecation warning for add_rows to be displayed in the browser
by setting show_in_browser=True. Updated the unit test to verify this
behavior and added an E2E test to confirm the warning appears on the frontend.

Co-Authored-By: Claude <[email protected]>
Copilot AI review requested due to automatic review settings January 17, 2026 16:52
@snyk-io
Copy link
Copy Markdown
Contributor

snyk-io bot commented Jan 17, 2026

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
Copy Markdown
Contributor

github-actions bot commented Jan 17, 2026

✅ PR preview is ready!

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

@lukasmasuch lukasmasuch changed the title Set add_rows deprecation warning to show in browser Set add_rows deprecation warning to show in browser Jan 17, 2026
@lukasmasuch lukasmasuch added change:breaking PR contains breaking change that affects backwards compatibility change:refactor PR contains code refactoring without behavior change impact:users PR changes affect end users security-assessment-completed labels Jan 17, 2026
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Copy link
Copy Markdown
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 enables the add_rows deprecation warning to be displayed in the browser by changing show_in_browser from False to True in the deprecation warning call. This ensures users see the deprecation notice in the Streamlit frontend.

Changes:

  • Modified the deprecation warning for add_rows to show in the browser instead of only in logs
  • Updated the unit test to verify the show_in_browser=True parameter
  • Added an E2E test to verify deprecation warnings appear in the browser UI

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
lib/streamlit/elements/arrow.py Changed show_in_browser parameter from False to True in the add_rows deprecation warning
lib/tests/streamlit/elements/arrow_add_rows_test.py Updated unit test assertion to expect show_in_browser=True
e2e_playwright/st_add_rows_test.py Added new E2E test to verify deprecation warnings are displayed in the browser

The add_rows deprecation warning now shows in browser, which adds an
alert to the delta queue. This affects tests that use get_delta_from_queue()
after calling add_rows(). Mock the warning in these tests to keep the
queue behavior consistent.

Co-Authored-By: Claude <[email protected]>
lukasmasuch and others added 9 commits January 17, 2026 18:18
- test_raises_an_exception_when_shapes_dont_match: Use .first to handle
  multiple alerts (14 deprecation warnings + 1 shape error)
- test_shows_deprecation_warning_in_browser: Fix text filter (backticks
  are rendered as markdown) and update count to 14 (actual add_rows calls)

Co-Authored-By: Claude <[email protected]>
Add a show_once parameter that ensures the same deprecation warning is
only shown once per unique message (tracked by message hash in a
module-level set). This is useful for warnings that may be triggered
many times during a script run.

Update add_rows to use show_once=True so users only see the deprecation
warning once instead of for every add_rows call.

Co-Authored-By: Claude <[email protected]>
Using calc_md5 provides more robust hashing with virtually no collision
risk, compared to Python's built-in hash() which could theoretically
produce collisions for different messages.

Co-Authored-By: Claude <[email protected]>
E2E tests share a server, so _shown_warnings persists across test runs,
making the test unreliable. The deprecation warning functionality is
properly covered by unit tests in deprecation_util_test.py.

Co-Authored-By: Claude <[email protected]>
Replace the deprecated add_rows pattern with st.empty() container
and full chart updates. This demonstrates the recommended approach
for animating charts.

Co-Authored-By: Claude <[email protected]>
Full chart updates are slower than add_rows, so reduce the sleep time
from 0.05s to 0.02s per iteration to keep the demo within E2E test
timeout limits.

Co-Authored-By: Claude <[email protected]>
Reduces the sleep time from 0.02s to 0.01s to give webkit browser
more time headroom in E2E tests.

Co-Authored-By: Claude <[email protected]>
Reduces iterations from 100 to 50 while maintaining the 100% progress
display by scaling the progress value. This halves the number of full
chart renders, fixing the webkit E2E test timeout.

Co-Authored-By: Claude <[email protected]>
The chart now has 251 data points instead of 501 due to the reduced
iterations, resulting in updated snapshot images.

Co-Authored-By: Claude <[email protected]>
@lukasmasuch lukasmasuch merged commit eb73206 into develop Jan 27, 2026
44 of 46 checks passed
@lukasmasuch lukasmasuch deleted the lukasmasuch/add-rows-warning branch January 27, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:breaking PR contains breaking change that affects backwards compatibility change:refactor PR contains code refactoring without behavior change impact:users PR changes affect end users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants