Repository navigation
Conversation
…ep a passed None `get_block_state` fell back to the block's own default whenever the state held None. That let a later block in a sequence swap in its default on top of the first block's, and made a passed None indistinguishable from "not passed". Now a missing input is filled in by the first block that reads it and `set_block_state` records the fill, so every block after it reads the same value. The pipeline stores a passed None as is and no longer pre-fills a None default. Conditional branches need no special code: the branch that runs is the first reader. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
It shows that per-branch defaults do not affect sequential blocks: the first block that reads an input fills in its default and records it, so a later block with a different default reads the same value. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
sayakpaul
approved these changes
Oct 27, 2026
sayakpaul
left a comment
Member
There was a problem hiding this comment.
Nice work!
Ran the newly added tests on main and test_explicit_none_reaches_every_branch, test_branch_defaults_do_not_affect_sequential_blocks fail as expected.
Comment on lines
+591
to
+593
| if input_param.name in state.values: | ||
| # a value in the state, None included, is what the user passed or an earlier block set | ||
| value = state.get(input_param.name) |
Comment on lines
+626
to
+627
| # Only add if the value is different from what's in the state, or the state did not hold it yet (the | ||
| # default this block filled in, see `get_block_state`) |
Member
There was a problem hiding this comment.
Could we also supplement this with an example? Just makes reading the code a bit easier.
This branch has not been 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.
Related to #14234, which let the branches of a conditional block declare different defaults for the same input. It did that by having
get_block_statefill in the block's default whenever the state heldNone. That made passingNoneindistinguishable from not passing the argument at all: both got the default of the first block that ran.This does not cause a bug in any pipeline in the code base today, but we want to fix it because:
Noneare different things.None, the same input isNonein the first block and becomes the second block's default in the second. No pipeline in the code base has this pattern so no officially supported pipeline is affected this way.This PR supports per-branch defaults differently. A
Nonepassed by the user is stored in the state as is (Note that it's the behavior before #14234 so we just restore it). An omitted input is filled in by the first block that reads it, andset_block_staterecords the fill, so the blocks after it read the same value. Conditional branches need no special code: the branch that runs is the first reader.Tests: a passed
Nonereaches every branch (test_conditional_pipeline_blocks.py); in a sequence the later block reads the recorded value instead of its own default (test_sequential_pipeline_blocks.py).