Fix Logical operator (#2143)

### What problem does this PR solve?

#2120 

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
H 2024-08-28 19:04:48 +08:00 committed by GitHub
parent a0b7c78dca
commit 527ebec2f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -42,8 +42,6 @@ class SwitchParam(ComponentParamBase):
self.check_empty(self.conditions, "[Switch] conditions") self.check_empty(self.conditions, "[Switch] conditions")
for cond in self.conditions: for cond in self.conditions:
if not cond["to"]: raise ValueError(f"[Switch] 'To' can not be empty!") if not cond["to"]: raise ValueError(f"[Switch] 'To' can not be empty!")
if cond["logical_operator"] not in ["and", "or"] and len(cond["items"]) > 1:
raise ValueError(f"[Switch] Please set logical_operator correctly!")
class Switch(ComponentBase, ABC): class Switch(ComponentBase, ABC):