Implement rx input overrides - #1190
Open
philippjfr wants to merge 7 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1190 +/- ##
==========================================
+ Coverage 87.27% 87.62% +0.34%
==========================================
Files 9 9
Lines 5550 5679 +129
==========================================
+ Hits 4844 4976 +132
+ Misses 706 703 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
hoxbro
reviewed
Sep 11, 2026
hoxbro
left a comment
Member
There was a problem hiding this comment.
Is it expected for an overridden parameter to still trigger events? I would imagine if you have made something static it does not make sense to trigger something downstream, could be wrong though.
import param
a = param.rx(2)
b = param.rx(10) * a
c = param.rx(10) * b
b_events, c_events = [], []
b.rx.watch(b_events.append)
c.rx.watch(c_events.append)
b.rx.overrides[0] = 1
a.rx.value = 5
a.rx.value = 9
print("b:", b.rx.value, "c:", c.rx.value) # b: 10 c: 100
print("b_events:", b_events) # b_events: [10, 10, 10]
print("c_events:", c_events) # c_events: [100, 100, 100]
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.
When building complex reactive graphs you sometimes want to test assumptions or temporarily freeze specific values. To achieve this you have to fully rebuild the
rxgraph from scratch right now, this PR instead offers a mechanism to registeroverrideson a node that supersede the actual inputs.This PR adds
.rx.overrides, a mutable mapping on a node that addresses the inputs it was wired with, by keyword name or by positional index:The interposition is local to this node's consumption of the input, so every other consumer of
fxkeeps seeing the live value and is neither notified nor recomputed. Because the override replaces the input before it is resolved, it lands ahead of every guard the node applies to its inputs, and masks an input that failed, one that has not resolved yet and one that skipped, without the node having to be wired withprocess_failures=True:Overrides are node-local, like
.rx.meta: a derived node has its own, empty mapping, and only an input the node was wired with can be overridden, so an unknown key raisesKeyErrornaming the inputs that exist. Overriding is a plain replacement; a consumer that needs to merge an override into the live value computes the merged value itself.AI Disclosure
Tool & Model: Kilo Code + amazon-bedrock/us.anthropic.claude-opus-5
Usage: Used to spike the invalidation options and measure them, implement the feature, add tests, run the test suite and type checkers, and draft this description.
Checklist