fix: Fix the parameter issue of the str.format(...) method#5119
fix: Fix the parameter issue of the str.format(...) method#5119liuruibin merged 3 commits into1Panel-dev:v2from
str.format(...) method#5119Conversation
|
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 |
| **kwargs): | ||
| chat_model = get_model_instance_by_model_workspace_id(model_id, workspace_id, | ||
| **model_params_setting) if model_id is not None else None | ||
| **(model_params_setting or {})) if model_id is not None else None |
| self.workflow_manage.params.get('knowledge_base') or {}) | ||
| maxkb_logger.error(_('data source web node:{node_id} error{error}{traceback}').format( | ||
| knowledge_id=node_id, error=str(e), traceback=traceback.format_exc())) | ||
| node_id=node_id, error=str(e), traceback=traceback.format_exc())) |
There was a problem hiding this comment.
参数名错误,正确的是 node_id
| if node.properties.get('status', 200) != 200: | ||
| raise ValidationError( | ||
| ErrorDetail(_("Node {node} is unavailable").format(node.properties.get("stepName")))) | ||
| ErrorDetail(_("Node {node} is unavailable").format(node=node.properties.get("stepName")))) |
There was a problem hiding this comment.
未指定参数名 node
| except Exception as e: | ||
| maxkb_logger.error( | ||
| _('Vectorized knowledge: {knowledge_id} error {error} {traceback}'.format(knowledge_id=knowledge_id, | ||
| _('Vectorized knowledge: {knowledge_id} error {error} {traceback}').format(knowledge_id=knowledge_id, |
There was a problem hiding this comment.
format方法,在 _(...) 方法内部使用了,会导致多语言失效。
What this PR does / why we need it?
fix: Fix the parameter issue of the
str.format(...)methodSummary of your change
修复
str.format(...)方法的参数问题Please indicate you've done the following: