[fix] showErrorDetails config parsing for deprecation warnings#12794
Merged
sfc-gh-lwilby merged 2 commits intodevelopfrom Oct 16, 2025
Merged
[fix] showErrorDetails config parsing for deprecation warnings#12794sfc-gh-lwilby merged 2 commits intodevelopfrom
sfc-gh-lwilby merged 2 commits intodevelopfrom
Conversation
- Updated _error_details_in_browser_enabled() to properly check for 'full' or True variations - Fixed boolean coercion bug where all non-empty strings were treated as True - Added comprehensive tests for all showErrorDetails enum values - Updated docstring to accurately describe behavior Fixes #12743
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!
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug where deprecation warnings were incorrectly shown in the browser regardless of the client.showErrorDetails config value. The issue was that the function used boolean coercion which treated all non-empty strings as True, causing values like "stacktrace", "type", and "none" to show warnings when they shouldn't.
Key changes:
- Fixed
_error_details_in_browser_enabled()to properly check for"full"or legacyTruevariations - Added comprehensive parameterized tests covering all config values
- Updated documentation to clarify which config values show deprecation warnings
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/streamlit/deprecation_util.py | Fixed config parsing logic and updated docstrings to properly handle string enum values |
| lib/tests/streamlit/deprecation_util_test.py | Added comprehensive parameterized tests covering all showErrorDetails config values |
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
Fixes a bug where deprecation warnings were always shown in the browser regardless of the
client.showErrorDetailsconfig value. The issue was that_error_details_in_browser_enabled()usedbool()coercion, which treats all non-empty strings asTrue, causing"stacktrace","type", and"none"to incorrectly show deprecation warnings.Changes Made:
_error_details_in_browser_enabled(): Updated to properly check if value equals"full"or is a legacyTruevariation, matching the pattern used inexception.py"full","stacktrace","type","none", and legacyTrue/Falsevariations)True/False) continue to work as documentedExpected Behavior (now fixed):
"full"orTrue: ✅ Show deprecation warnings in browser"stacktrace","type","none", orFalse: ❌ Hide deprecation warnings in browser (console only)GitHub Issue Link (if applicable)
Fixes #12743
Testing Plan
showErrorDetailsconfig valuesst.cache, query params) and verified behavior with all config valuesManual Testing Details:
Test app and implementation summary available at: https://github.com/streamlit/st-issues/tree/main/issues/gh-12743
Additional Notes:
This bug was present since v1.41.0 (December 2024) when the config option was migrated from boolean to string enum values in PR #9909. The
deprecation_util.pyfile was not updated at that time to handle the new string values. The fix follows the same pattern already implemented inlib/streamlit/elements/exception.py.Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.