Repository navigation
[Fix] Slider step validation raises when max is set without min - #1838
Merged
petar-qb merged 3 commits intoAug 20, 2026
Merged
Conversation
validate_step guarded on max but then subtracted min unconditionally, so a slider configured with max and step but no min raised a TypeError during model validation. Compare step against the range only when both bounds are given, leaving the existing error for the case where they are.
winklemad
requested review from
Joseph-Perkins,
antonymilne,
huong-li-nguyen,
lingyielia,
maxschulz-COL and
stichbury
as code owners
August 18, 2026 11:29
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes Slider/RangeSlider step validation when one or both bounds are missing, and documents the fix.
Changes:
- Update
validate_stepto only comparestepvs(max - min)when both bounds are provided. - Add unit tests for
stepvalidation whenminand/ormaxisNone. - Update authors and add a changelog fragment describing the fix.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| vizro-core/src/vizro/models/_components/form/_form_utils.py | Prevents TypeError by guarding step validation behind presence of both bounds. |
| vizro-core/tests/unit/vizro/models/_components/form/test_slider.py | Adds regression coverage for Slider(step=..., min/max=None) scenarios. |
| vizro-core/tests/unit/vizro/models/_components/form/test_range_slider.py | Adds regression coverage for RangeSlider(step=..., min/max=None) scenarios. |
| vizro-core/docs/pages/explanation/authors.md | Adds a contributor to the authors list. |
| vizro-core/changelog.d/20260818_164803_winklemad.md | Adds a changelog entry for the fixed TypeError case. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
petar-qb
approved these changes
Aug 20, 2026
petar-qb
left a comment
Contributor
There was a problem hiding this comment.
Amazing fix @winklemad! 🚀 Thank you for your contribution.
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.
Description
A slider given
maxandstepbut nominfails to validate:validate_stepchecks thatmaxis set, then usesminregardless:vizro-core/src/vizro/models/_components/form/_form_utils.pyWith
minunset that subtraction is6.0 - None, so the error surfaces during model validation and the dashboard never builds. The guard now requires both bounds before comparingstepagainst the range; the existingValueErrorand its message are untouched for the case where both are supplied.The three neighbouring shapes already work and stay working:
minandstepwithoutmax,minandmaxandstep, andstepon its own.validate_stepis shared bySliderandRangeSlider, so tests were added on both sides.Screenshot
Not applicable — no visual change. The effect is that a config which previously raised during validation now builds.
Notice
I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":
Note: this touches
authors.md, as does my open PR #1837, so whichever merges second will need a one-line conflict resolved there. The two changes are otherwise independent — #1837 is in_controls/filter.py, this is in_components/form/_form_utils.py.