Skip to content

fix(flytectl): print execution details holding a NaN - #7897

Merged
Sovietaced merged 1 commit into
flyteorg:masterfrom
mitja-kleider:flytectl-nan
Aug 24, 2026
Merged

Sovietaced merged 1 commit into
flyteorg:masterfrom
mitja-kleider:flytectl-nan

Conversation

@mitja-kleider

Copy link
Copy Markdown
Contributor

Why are the changes needed?

flytectl get execution --details cannot print an execution whose node inputs or outputs hold a non-finite float:

$ flytectl get execution -p my-project -d production my-exec -o json --details
Error: json: unsupported value: NaN

The marshal happens before the output-format switch, so -o json and -o yaml fail 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 as null and the rest of the view survives.

How was this patch tested?

TestExtractLiteralMapNonFiniteFloats covers 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 that json.Marshal then succeeds. It fails without the fix, float64 NaN vs <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 flytectl v0.9.8 and on master:

$ flytectl get execution -p fl-default -d production my-failing-execution -o json --details
Error: json: unsupported value: NaN

After, with a binary built from this branch, the full details view prints, 33 node executions, with the three NaN eval metrics as null:

$ flytectl-patched get execution -p fl-default -d production my-failing-execution -o json --details
# details, no error

Labels

fixed

Check all the applicable boxes

  • I updated the documentation accordingly. (no user-facing behaviour to document beyond the changelog label)
  • All new and existing tests passed.
  • All commits are signed-off.

`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>
@github-actions github-actions Bot added the flyte label Aug 21, 2026
@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.00000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.25%. Comparing base (89cf9cc) to head (a73bc2f).

Files with missing lines Patch % Lines
flytectl/cmd/get/node_execution.go 70.00% 9 Missing ⚠️
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           
Flag Coverage Δ
unittests-datacatalog 53.51% <ø> (ø)
unittests-flyteadmin 53.23% <ø> (ø)
unittests-flytecopilot 48.05% <ø> (ø)
unittests-flytectl 64.11% <70.00%> (+0.02%) ⬆️
unittests-flyteidl 75.71% <ø> (ø)
unittests-flyteplugins 60.45% <ø> (ø)
unittests-flytepropeller 53.81% <ø> (ø)
unittests-flytestdlib 64.39% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Sovietaced merged commit e69f764 into flyteorg:master Aug 24, 2026
58 of 59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants