Move AttributeDictionary to main util file#11441
Merged
kajarenc merged 1 commit intoadd-theme-field-to-context-one-fieldfrom May 29, 2025
Merged
Move AttributeDictionary to main util file#11441kajarenc merged 1 commit intoadd-theme-field-to-context-one-fieldfrom
kajarenc merged 1 commit intoadd-theme-field-to-context-one-fieldfrom
Conversation
…imported in context.py
Contributor
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
Contributor
✅ PR preview is ready!
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the location of the AttributeDictionary class by moving it from streamlit/elements/lib/event_utils.py to the main util file, and updates all corresponding import statements accordingly.
- Centralizes the definition of AttributeDictionary in lib/streamlit/util.py
- Updates imports in context, vega_charts, plotly_chart, deck_gl_json_chart, and arrow
- Removes the duplicate implementation from event_utils
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| lib/streamlit/util.py | Added the AttributeDictionary class to centralize its usage |
| lib/streamlit/runtime/context.py | Updated the import to use the centralized AttributeDictionary |
| lib/streamlit/elements/vega_charts.py | Replaced the old import with the new centralized import for AttributeDictionary and calc_md5 |
| lib/streamlit/elements/plotly_chart.py | Replaced the old import with the new centralized import for AttributeDictionary |
| lib/streamlit/elements/lib/event_utils.py | Removed the duplicated AttributeDictionary implementation |
| lib/streamlit/elements/deck_gl_json_chart.py | Updated the import to use the centralized AttributeDictionary |
| lib/streamlit/elements/arrow.py | Updated the import for AttributeDictionary and refined kwargs type hinting |
ffb7dd5
into
add-theme-field-to-context-one-field
35 of 36 checks passed
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
Move AttributeDictionary to main util file, because now it is also imported in context.py
GitHub Issue Link (if applicable)
Testing Plan
Simple refactoring of moving class from one file to another, covered by existing tests
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.