Deprecate kwargs support for st.vega_lite_chart#13141
Merged
Merged
Conversation
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 pull request deprecates the variable keyword arguments (**kwargs) support in st.vega_lite_chart, requiring users to use the spec parameter instead for passing Vega-Lite configuration options. Additionally, it fixes an incorrect deprecation message in st.image.
Key Changes
- Added deprecation warning when
**kwargsare passed tost.vega_lite_chart - Added comprehensive unit tests to verify the deprecation warning behavior
- Fixed incorrect deprecation message in
st.imageto recommend thewidthparameter instead of the deprecateduse_container_widthparameter
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/streamlit/elements/vega_charts.py | Added deprecation warning logic that triggers when kwargs are passed to vega_lite_chart |
| lib/tests/streamlit/elements/vega_charts_test.py | Added two new tests: one to verify deprecation warning is shown when kwargs are used, another to verify no warning when kwargs are not used |
| lib/streamlit/elements/image.py | Fixed deprecation message to recommend width parameter instead of the also-deprecated use_container_width parameter |
| e2e_playwright/st_image_test.py | Updated e2e test assertion to match the corrected deprecation message |
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
Deprecates the *kwargs support in
st.vega_lite_chart. Thespecparameter should be used instead for passing spec configuration.Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.