-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix: Fix the wrong result of not_contain_compare when source_value is a list
#5152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
fc5b607
ec3d5fa
b09d0ca
134ed9a
75f239d
b9a02b1
27fc513
afacd7f
46218ef
2e8dced
b3e7b65
078bda5
ad2aff2
fbbdb70
1a72ba2
66ccc3a
8b94350
418ac71
d4527de
2817aee
2feaa9a
5ae0a84
6383670
4761094
a17aee7
9cb6364
5b842e5
12b0b93
c93c8cb
5679f6b
3ff563f
1d6ddee
314dfa1
1097cb0
5619117
8038ca3
915d03e
b857412
8de2060
a5a5792
613f996
37aec97
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ def support(self, node_id, fields: List[str], source_value, compare, target_valu | |
| def compare(self, source_value, compare, target_value): | ||
| if isinstance(source_value, str): | ||
| return str(target_value) not in source_value | ||
| elif isinstance(self, list): | ||
| elif isinstance(source_value, list): | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 此PR的核心修复点 |
||
| return not any([str(item) == str(target_value) for item in source_value]) | ||
| else: | ||
| return str(target_value) not in str(source_value) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -110,7 +110,8 @@ def convert_value(name: str, value, _type, is_required, source, node): | |
| if _type == 'int': | ||
| return int(value) | ||
| if _type == 'boolean': | ||
| value = 0 if ['0', '[]'].__contains__(value) else value | ||
| if isinstance(value, str) and value.lower() in ('false', '0', '[]', ''): | ||
| return False | ||
| return bool(value) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 修复当 |
||
| if _type == 'float': | ||
| return float(value) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,7 +64,6 @@ def get(self, request: Request, workspace_id: str, knowledge_id: str, document_i | |
| @log( | ||
| menu='Paragraph', operate='Create Paragraph', | ||
| get_operation_object=lambda r, keywords: get_knowledge_document_operation_object( | ||
| get_knowledge_operation_object(keywords.get('knowledge_id')), | ||
| get_knowledge_operation_object(keywords.get('knowledge_id')), | ||
| get_document_operation_object(keywords.get('document_id')) | ||
| ), | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
感觉应该是不小心多复制了一行代码。 |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -243,11 +243,11 @@ def execute(trigger, **kwargs): | |
| if source_type == "APPLICATION": | ||
| from trigger.handler.impl.task.application_task import ApplicationTask | ||
|
|
||
| ApplicationTask.execute(trigger_task, **kwargs) | ||
| ApplicationTask().execute(trigger_task, **kwargs) | ||
| elif source_type == "TOOL": | ||
| from trigger.handler.impl.task.tool_task import ToolTask | ||
|
|
||
| ToolTask.execute(trigger_task, **kwargs) | ||
| ToolTask().execute(trigger_task, **kwargs) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| else: | ||
| maxkb_logger.warning(f"unsupported source_type={source_type}, task_id={trigger_task['id']}") | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix style