Skip to content

Conversation

@shaohuzhang1
Copy link
Contributor

fix: Variable splitting and parameter extraction result in data loss when there is a form collection node

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Oct 22, 2025

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Oct 22, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

self.context[key] = value
self.context['result'] = details.get('result')

def execute(self, input_variable, variable_list, model_params_setting, model_id, **kwargs) -> NodeResult:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No obvious irregularities identified in the provided code snippet. Here's a brief review:

class BaseParameterExtractionNode(IParameterExtractionNode):
    # (other methods remain unchanged)

def save_context(self, details, workflow_manage):
    # Loop through each key-value pair in 'result'
    for key, value in details.get('result'). items():
        # Assign value to context with the current key
        self.context[key] = value
    # Store entire result dictionary in context
    self.context['result'] = details.get('result')

# Method remains largely intact, no further changes suggested

The code is generally clean and efficient for setting up the context based on the extracted results from details. There are no syntax errors or logical issues within this segment of the code at the given time.

self.context[key] = value
self.context['result'] = details.get('result')

def execute(self, input_variable, variable_list, **kwargs) -> NodeResult:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The provided code makes several improvements:

  1. The save_context method now properly assigns the values to keys in the context dictionary without directly setting "self.context['key']".
  2. It removes unnecessary usage of 'result' twice within the same assignment.
  3. The overall method structure remains clear and concise.

In terms of optimization: none significant changes have been made, but here's a small note for future maintenance:
Consider using f-strings if you're adding more string interpolations in other part of your codebase, which would make it easier to read.

Improvements Made:

  • Replaced direct access with proper iteration
  • Removed redundant key assignments

@shaohuzhang1 shaohuzhang1 merged commit 9c6bf01 into v2 Oct 22, 2025
4 of 6 checks passed
@shaohuzhang1 shaohuzhang1 deleted the pr@v2@fix_workflow branch October 22, 2025 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants