Repository navigation
fix: pass falsy iteration items (0, "", false, [], {}) to item() - #181
Open
Florian BURELLI (florian-burelli) wants to merge 1 commit into
Open
Florian BURELLI (florian-burelli) wants to merge 1 commit into
Florian BURELLI (florian-burelli) wants to merge 1 commit into
Conversation
The expressions evaluator tested `state.iteration_item` for truthiness before serializing it, so any falsy item was sent to the .NET evaluator as "no item" and `item()` raised `StateIterationItemNotSetError`. `@range(0, n)` therefore failed on its first iteration. Test for `None` instead, which is what `PipelineRunState` uses to mean "no item". Fixes microsoft#177 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Florian BURELLI (@florian-burelli) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
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.
Fixes #177
Problem
DataFactoryTestingFrameworkExpressionsEvaluator.evaluateserializes the iteration item withso any falsy item is sent to the .NET evaluator as "no item" and
item()raisesStateIterationItemNotSetError.@range(0, n)therefore fails on its first iteration; the same happens for"",false,[]and{}.Change
state.iteration_item is not Noneinstead.Noneis already whatPipelineRunStateuses to mean "no item" (create_iteration_scopekeeps the parent item only when the new oneis None), so the two sides now agree.Tests
test_data_factory_testing_framework_expression_evaluator.py:@item()evaluates to0,"",False,[]and{}when the state holds those items. All 5 fail onmain.test_for_each_activity.py: a ForEach over@range(0, 3)yields items[0, 1, 2]. Fails onmain.Full suite: 227 passed. Ruff check and format clean.
🤖 Generated with Claude Code