Skip to content

treat nil variableMap as empty so no-input tasks can launch - #7722

Merged
ursucarina merged 1 commit into
mainfrom
carina/fixvarmaptranslator
Jul 28, 2026
Merged

treat nil variableMap as empty so no-input tasks can launch#7722
ursucarina merged 1 commit into
mainfrom
carina/fixvarmaptranslator

Conversation

@ursucarina

Copy link
Copy Markdown
Contributor

Why are the changes needed?

JSONValuesToLiterals errored with variableMap cannot be nil when passed a nil variableMap. That happens legitimately for a task with no declared inputs — its interface.inputs is unset, so callers (e.g. the launch form converting form values back to literals) pass a nil map. There are no expected inputs in that case, so it should produce zero literals rather than fail.

What changes were proposed in this pull request?

In JSONValuesToLiterals, treat a nil variableMap as an empty one instead of erroring. An empty payload yields no literals, and any provided values are unmapped and ignored (debug-logged), consistent with the existing unmapped-field handling.

How was this patch tested?

go test ./dataproxy/converter/... — passing. Updated the nil-variableMap test to assert an empty result with no error (both an empty payload and a payload whose values have no matching variable).

Labels

fixed

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Stack

If you do use git town to manage PR Stacks, the stack relevant to this PR
will show below. Otherwise, you can ignore this section.

Docs link

Copilot AI review requested due to automatic review settings July 28, 2026 20:52
@ursucarina ursucarina added the fixed For any bug fixes label Jul 28, 2026

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

This PR adjusts the dataproxy JSON→Literal conversion behavior to support tasks with no declared inputs by treating a nil VariableMap as an empty input interface, preventing an unnecessary invalid-argument failure during launch-form conversions.

Changes:

  • Update JSONValuesToLiterals to treat nil variableMap as empty instead of returning an error.
  • Align inline documentation to reflect that unmapped fields are ignored and debug-logged (matching the current logger.Debugf behavior).
  • Update unit tests to assert the new behavior for nil variableMap (empty payload and payload with only unmapped values).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
dataproxy/converter/literal_json_converter.go Treats nil input VariableMap as empty and clarifies logging semantics for unmapped fields.
dataproxy/converter/literal_json_converter_test.go Updates tests to validate that nil variableMap yields no literals and no error.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ursucarina
ursucarina enabled auto-merge (squash) July 28, 2026 20:54
@ursucarina
ursucarina merged commit 8871517 into main Jul 28, 2026
24 of 27 checks passed
@ursucarina
ursucarina deleted the carina/fixvarmaptranslator branch July 28, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fixed For any bug fixes flyte2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants