Return the output node message as a named output entry - #64
Open
pedroigorjs wants to merge 2 commits into
Open
Conversation
The message of Output and MultipleOutputs nodes is now appended to the normalized outputs list as an entry named message, so consumers reading the list uniformly can reach it. A null message emits nothing, and a terminal node that produced no value emits neither value nor message, which keeps the message scoped to the branch that actually ran. MultipleOutputs emits one message entry after all of its keys instead of repeating it on every key. The inline message key stays on the value entries and the new entry carries it too, so every dict in outputs keeps the same shape.
Coverage Report
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Coverage Report
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
What
The
messagefield ofOutputandMultipleOutputsnodes now shows up as a regular entry in the normalizedoutputslist, usingmessageas its name.Before:
After:
Why
Consumers of
Execution.to_normalized_dict()read theoutputslist as a flat collection of named values. The message was only reachable as an extra key inside each value entry, so anyone treating the list uniformly never saw it. Exposing it as its own named entry makes the message available through the same access pattern as every other output.How
The change lives in
normalize_execution_for_debug_iterinretrack/utils/transformers.py. For each terminal node we now count how many entries it contributed and append a singlemessageentry right after them.Rules applied:
Outputnodes.MultipleOutputsemits one message entry after all of its keys instead of repeating the message on every key.Backwards compatibility
The inline
messagekey stays on the value entries, so existing readers keep working. The new entry also carries amessagekey with the same content, which means every dict inoutputsstill has the same shape and code that readsentry["message"]across the whole list will not raise aKeyError.Released as
3.8.0a0so the new shape can be validated by a consumer before the final minor.Testing
Five expectations in
tests/test_transformers/test_normalize_debug.pywere updated and two cases were added, one covering a filled message on a node without a value and one covering a graph where only the executedOutputemits its message. Thetests/resources/executions/multiple-ifs.jsonfixture was regenerated. Full suite passes with 139 tests.