fix switch bug (#3280)

### What problem does this PR solve?


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu 2024-11-08 10:08:57 +08:00 committed by GitHub
parent ff2bbb487f
commit f16ef57979
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -52,7 +52,7 @@ class Switch(ComponentBase, ABC):
res = [] res = []
for item in cond["items"]: for item in cond["items"]:
out = self._canvas.get_component(item["cpn_id"])["obj"].output()[1] out = self._canvas.get_component(item["cpn_id"])["obj"].output()[1]
cpn_input = "" if "content" not in out.columns else " ".join(out["content"]) cpn_input = "" if "content" not in out.columns else " ".join([str(s) for s in out["content"]])
res.append(self.process_operator(cpn_input, item["operator"], item["value"])) res.append(self.process_operator(cpn_input, item["operator"], item["value"]))
if cond["logical_operator"] != "and" and any(res): if cond["logical_operator"] != "and" and any(res):
return Switch.be_output(cond["to"]) return Switch.be_output(cond["to"])