Set add_rows deprecation warning to show in browser#13628
Merged
lukasmasuch merged 11 commits intodevelopfrom Jan 27, 2026
Merged
Set add_rows deprecation warning to show in browser#13628lukasmasuch merged 11 commits intodevelopfrom
add_rows deprecation warning to show in browser#13628lukasmasuch merged 11 commits intodevelopfrom
Conversation
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]>
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!
|
add_rows deprecation warning to show in browser
There was a problem hiding this comment.
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.
Contributor
There was a problem hiding this comment.
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_rowsto show in the browser instead of only in logs - Updated the unit test to verify the
show_in_browser=Trueparameter - 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]>
- 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]>
mayagbarnes
approved these changes
Jan 26, 2026
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
Enable the
add_rowsdeprecation warning to be displayed in the browser by settingshow_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
show_in_browser=Trueis setadd_rowscalls 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.