[fix] Support boolean values for client.showErrorLinks config option#13806
[fix] Support boolean values for client.showErrorLinks config option#13806sfc-gh-nbellante merged 1 commit intodevelopfrom
Conversation
The client.showErrorLinks config option was only accepting string values
("auto", "true", "false"). This change adds support for boolean values
(True, False), matching the behavior of other config options like
client.showSidebarNavigation.
This allows users to set the option programmatically without needing
to convert booleans to strings.
✅ PR preview is ready!
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
SummaryThis PR fixes the Files changed:
Code QualityThe implementation is clean and follows existing patterns in the codebase:
Test CoverageThe test coverage is adequate:
The tests follow the existing pattern in the
Note on anti-regression assertions: The Python test guidelines recommend including negative assertions when practical. While the new tests don't include explicit assertions that other enum values are NOT returned, this is consistent with the existing tests in the same class. The assertion equality check implicitly validates this. Backwards CompatibilityFully backwards compatible. This change only adds new functionality without modifying existing behavior:
The boolean handling is checked first, so it takes priority, but since booleans and strings are distinct types in Python, this cannot interfere with existing string-based configurations. Security & RiskLow risk. This is a straightforward bug fix with:
Edge cases handled correctly:
RecommendationsNo required changes. The PR is ready for merge. Optional improvements (not blocking):
VerdictAPPROVED: Clean, well-tested bug fix that correctly handles boolean config values from TOML files while maintaining full backwards compatibility with existing string-based configurations. This is an automated AI review using |
✅ 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. |
There was a problem hiding this comment.
Pull request overview
This PR extends the client.showErrorLinks configuration handling so that boolean values (True/False) are supported alongside existing string values ("auto", "true", "false"), fixing cases where a boolean in config.toml or programmatic settings previously failed.
Changes:
- Updated
_get_show_error_linksto interpret boolean config values and map them to the appropriateConfig.ShowErrorLinksenum before performing string validation. - Added unit tests to cover
client.showErrorLinkswhen set toTrueandFalse, alongside the existing string-based tests and invalid-value check.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/streamlit/runtime/app_session.py | Updates _get_show_error_links to handle boolean config values by returning the correct ShowErrorLinks enum for True/False before falling back to the existing string-based validation and mapping. |
| lib/tests/streamlit/runtime/app_session_test.py | Extends GetShowErrorLinksTest with two new tests ensuring client.showErrorLinks set to True or False resolves to the correct enum value, preserving the invalid-value error behavior. |
…13806) ## Summary Fixes the `client.showErrorLinks` config option to accept boolean values (`True`/`False`) in addition to string values (`"auto"`, `"true"`, `"false"`). Previously, setting the config option with a boolean like `client.showErrorLinks = false` in config.toml would not work because the code only checked for string values. This change aligns `showErrorLinks` with the behavior of other config options that accept both boolean and string values. ## Test plan - Added unit tests for boolean `True` and `False` values - All existing tests pass - Verified manually that `client.showErrorLinks = false` in config.toml now works correctly

Summary
Fixes the
client.showErrorLinksconfig option to accept boolean values (True/False) in addition to string values ("auto","true","false").Previously, setting the config option with a boolean like
client.showErrorLinks = falsein config.toml would not work because the code only checked for string values. This change alignsshowErrorLinkswith the behavior of other config options that accept both boolean and string values.Test plan
TrueandFalsevaluesclient.showErrorLinks = falsein config.toml now works correctly