Skip to content

Move AttributeDictionary to main util file#11441

Merged
kajarenc merged 1 commit intoadd-theme-field-to-context-one-fieldfrom
move-AttributeDictionary-to-global-util
May 29, 2025
Merged

Move AttributeDictionary to main util file#11441
kajarenc merged 1 commit intoadd-theme-field-to-context-one-fieldfrom
move-AttributeDictionary-to-global-util

Conversation

@kajarenc
Copy link
Copy Markdown
Contributor

@kajarenc kajarenc commented May 23, 2025

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

  • Explanation of why no additional tests are needed
  • Unit Tests (JS and/or Python)
  • E2E Tests
  • Any manual testing needed?

Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@snyk-io
Copy link
Copy Markdown
Contributor

snyk-io bot commented May 23, 2025

🎉 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)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 23, 2025

✅ PR preview is ready!

Name Link
📦 Wheel file https://core-previews.s3-us-west-2.amazonaws.com/pr-11441/streamlit-1.45.1-py3-none-any.whl
🕹️ Preview app pr-11441.streamlit.app (☁️ Deploy here if not accessible)

@kajarenc kajarenc changed the title Move AttributeDictionary to global util file, because now it is also … Move AttributeDictionary to main util file May 23, 2025
@kajarenc kajarenc added security-assessment-completed impact:internal PR changes only affect internal code change:chore PR contains maintenance or housekeeping change labels May 23, 2025
@kajarenc kajarenc marked this pull request as ready for review May 23, 2025 14:14
@sfc-gh-lmasuch sfc-gh-lmasuch requested a review from Copilot May 27, 2025 13:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

@lukasmasuch lukasmasuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@kajarenc kajarenc merged commit ffb7dd5 into add-theme-field-to-context-one-field May 29, 2025
35 of 36 checks passed
@kajarenc kajarenc deleted the move-AttributeDictionary-to-global-util branch May 29, 2025 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:chore PR contains maintenance or housekeeping change impact:internal PR changes only affect internal code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants