From b06957e5614066d043b63be33b177d93971f59bc Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Wed, 17 Jul 2024 11:33:49 +0800 Subject: [PATCH] fix emmpty input in graph (#1560) ### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- graph/component/base.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/graph/component/base.py b/graph/component/base.py index 82e2f18c7..f0f6367f8 100644 --- a/graph/component/base.py +++ b/graph/component/base.py @@ -456,12 +456,17 @@ class ComponentBase(ABC): break break if self.component_name.lower().find("answer") >= 0: - if self.get_component_name(u) in ["relevant"]: continue - - else: upstream_outs.append(self._canvas.get_component(u)["obj"].output(allow_partial=False)[1]) + if self.get_component_name(u) in ["relevant"]: + continue + else: + o = self._canvas.get_component(u)["obj"].output(allow_partial=False)[1] + if o is not None: + upstream_outs.append(o) break - return pd.concat(upstream_outs, ignore_index=False) + if upstream_outs: + return pd.concat(upstream_outs, ignore_index=False) + return pd.DataFrame() def get_stream_input(self): reversed_cpnts = []