fix: The parameter extraction node does not display input parameters in the execution details#4239
Conversation
…in the execution details
|
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. DetailsInstructions 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. |
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
| 'request': self.context.get('request'), | ||
| 'result': self.context.get('result'), | ||
| 'status': self.status, | ||
| 'err_message': self.err_message |
There was a problem hiding this comment.
Yes, there are two issues. You forgot to add 'self' before calling methods on workflow_manage. The second issue is that you're trying to access keys from self.context that don't exist when they should be set.
Here's the corrected code:
@@ -88,8 +88,10 @@ def save_context(self, details, workflow_manage):
for key, value in details.get('result').items():
self.context[key] = value
self.context['result'] = details.get('result')
-
self.context['request'] = details.get('request', '')def execute(self, input_variable, variable_list, model_params_setting, model_id, **kwargs) -> NodeResult:
-
# Make sure context request doesn't error out when it shouldn't. -
self.request = kwargs.get('request') if isinstance(input_variable, dict) and 'request' in input_variable else '' if model_params_setting is None: model_params_setting = get_default_model_params_setting(model_id) workspace_id = self.workflow_manage.get_body().get('workspace_id')
@@ -106,6 +108,7 @@ def get_details(self, index: int, **kwargs):
"index": index,
'run_time': self.context.get('run_time'),
'type': self.node.type,
-
'request': self.context.get('request'), # Corrected this line 'result': self.context.get('result'), 'status': self.status, 'err_message': self.err_message
| 'request': self.context.get('request'), | ||
| 'result': self.context.get('result'), | ||
| 'status': self.status, | ||
| 'err_message': self.err_message |
There was a problem hiding this comment.
- In the
save_contextmethod, adding'request'to the context dictionary ensures that all necessary data is stored. - It's a good practice to initialize all variables used within methods before they are accessed.
- Consider using more descriptive variable names to improve code readability.
- Adding logging could be beneficial during debugging.
fix: The parameter extraction node does not display input parameters in the execution details