Kevin Hu
commited on
Commit
·
9cf0c51
1
Parent(s):
140db5b
fix `switch` bug (#3280)
Browse files### What problem does this PR solve?
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
agent/component/switch.py
CHANGED
@@ -52,7 +52,7 @@ class Switch(ComponentBase, ABC):
|
|
52 |
res = []
|
53 |
for item in cond["items"]:
|
54 |
out = self._canvas.get_component(item["cpn_id"])["obj"].output()[1]
|
55 |
-
cpn_input = "" if "content" not in out.columns else " ".join(out["content"])
|
56 |
res.append(self.process_operator(cpn_input, item["operator"], item["value"]))
|
57 |
if cond["logical_operator"] != "and" and any(res):
|
58 |
return Switch.be_output(cond["to"])
|
|
|
52 |
res = []
|
53 |
for item in cond["items"]:
|
54 |
out = self._canvas.get_component(item["cpn_id"])["obj"].output()[1]
|
55 |
+
cpn_input = "" if "content" not in out.columns else " ".join([str(s) for s in out["content"]])
|
56 |
res.append(self.process_operator(cpn_input, item["operator"], item["value"]))
|
57 |
if cond["logical_operator"] != "and" and any(res):
|
58 |
return Switch.be_output(cond["to"])
|