fix(flytectl): print execution details holding a NaN - #7897
Merged
Merged
Conversation
`flytectl get execution --details` extracts each node's input and output
literals into a map[string]interface{} and hands it to encoding/json, which
refuses non-finite floats. One task output that came out NaN - an eval
metric, say - therefore loses the entire detailed view of the execution, in
every output format:
$ flytectl get execution -p p -d production my-exec -o json --details
Error: json: unsupported value: NaN
Non-finite floats now extract as nil, so they print as null and the rest of
the view survives.
Signed-off-by: Mitja Kleider <mitja.kleider@aleph-alpha.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7897 +/- ##
=======================================
Coverage 57.24% 57.25%
=======================================
Files 931 931
Lines 58279 58308 +29
=======================================
+ Hits 33363 33383 +20
- Misses 21857 21866 +9
Partials 3059 3059
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Prevents detailed execution output from failing when node literals contain NaN or infinite floats.
Changes:
- Recursively replaces non-finite floats with
nil. - Adds tests for primitive, map, and generic literals.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
flytectl/cmd/get/node_execution.go |
Sanitizes extracted literals before output serialization. |
flytectl/cmd/get/node_execution_test.go |
Verifies sanitization and successful JSON marshaling. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sovietaced
approved these changes
Aug 24, 2026
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.
Why are the changes needed?
flytectl get execution --detailscannot print an execution whose node inputs or outputs hold a non-finite float:The marshal happens before the output-format switch, so
-o jsonand-o yamlfail alike and nothing at all is printed: one task output that came out NaN loses the whole detailed view of every node in the execution.What changes were proposed in this pull request?
Extracted non-finite floats become
nil, so they print asnulland the rest of the view survives.How was this patch tested?
TestExtractLiteralMapNonFiniteFloatscovers a float primitive (NaN, +Inf, -Inf, alongside a finite value that must survive), a map literal holding a NaN, and a generic literal holding one, asserting both the extracted value and thatjson.Marshalthen succeeds. It fails without the fix,float64 NaNvs<nil>plus the two marshal errors.go test ./cmd/get/...passes.Checked against the real command as well, on an execution that reproduces the failure. Before, on
flytectlv0.9.8 and onmaster:After, with a binary built from this branch, the full details view prints, 33 node executions, with the three NaN eval metrics as
null:Labels
fixed
Check all the applicable boxes