Conversation
✅ 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. |
✅ PR preview is ready!
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for Altair 6.x by updating the dependency constraint and adapting code to handle version-specific behavior changes in Altair's parameter naming strategy.
Key Changes:
- Updates Altair version constraint from
<6to<7to allow Altair 6.x versions - Skips parameter counter normalization for Altair >= 6.0.0, as this version no longer uses global counters for unnamed parameters
- Updates E2E test assertions to use flexible regex patterns that work with both Altair 5.x and 6.x parameter naming schemes
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/setup.py | Updates Altair version constraint to <7 to allow version 6.x |
| lib/streamlit/elements/vega_charts.py | Adds version check to skip counter reset logic for Altair >= 6.0.0 and updates docstring |
| e2e_playwright/st_altair_chart_basic_select_test.py | Updates regex patterns to match variable parameter names (from param_1 to param_.+) to support both Altair versions |
|
|
||
| # Altair 6.0.0 introduced a new way to handle parameters, | ||
| # by using hashes instead of pure counters: | ||
| pattern = re.compile(rf'"{prefix}[0-9a-z]+"') |
There was a problem hiding this comment.
Theoretically, altair >=6.0.0 uses stable hashes instead of unstable counters. However, if we would remove this code path for altair >=6.0.0 it would break some apps. Keeping the old logic for now ...
There was a problem hiding this comment.
Do we have any tests for this?
There was a problem hiding this comment.
Added some unit tests to cover the old-counter and the new hash-based IDs. With this change, all the relevant e2e tests will also run with the new hash-based pattern.
Describe your changes
Adds support for Altair 6. This is a requirement for official Python 3.14 support.
GitHub Issue Link (if applicable)
Testing Plan
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.