Repository navigation
fix(dates): date_range default respects a single supplied bound - #10649
Merged
Light2Dark merged 1 commit intoSep 10, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
kirangadhave
requested review from
kirangadhave
and
a lite review from Copilot
August 25, 2026 15:56
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes mo.ui.date_range default value derivation so that when value is omitted and only one bound is provided, the widget initializes within its declared bounds (matching mo.ui.date / mo.ui.datetime behavior).
Changes:
- Adjust
date_rangedefaulting logic:start=X → (X, X),stop=Y → (Y, Y), both bounds →(start, stop), neither →(today, today). - Ensure bounds validation runs for the derived default (not just user-supplied
value). - Add regression tests for start-only and stop-only default behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
marimo/_plugins/ui/_impl/dates.py |
Updates date_range default-value derivation and documents the new defaulting rules. |
tests/_plugins/ui/_impl/test_dates.py |
Adds tests to cover single-bound default behavior for date_range. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
kirangadhave
marked this pull request as ready for review
August 31, 2026 21:01
When only one of start/stop was given without an explicit value, date_range fell back to (today, today), which can violate the declared [start, stop] range, and it skipped bounds validation on that path. Mirror the date/datetime siblings by clamping the default to the supplied bound and run bounds validation for the derived default too.
winklemad
force-pushed
the
fix/date-range-single-bound-default
branch
from
September 4, 2026 20:11
c76dead to
307714a
Compare
kirangadhave
approved these changes
Sep 8, 2026
This branch was successfully deployed
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.
This pull request was authored by a coding agent.
📝 Summary
Closes #10648
mo.ui.date_rangederived its default value differently frommo.ui.date/mo.ui.datetime: when only one ofstart/stopwas given (and no explicitvalue), it fell back to(today, today)and ignored the supplied bound, so the widget initialized outside its own declared range, and theNone-value path skipped bounds validation.This clamps the default to the supplied bound, matching the siblings —
start=X→(X, X),stop=Y→(Y, Y), both given →(start, stop), neither →(today, today).📋 Pre-Review Checklist
✅ Merge Checklist
start-only andstop-only).