mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Fix exec sql exception issue. (#3982)
### What problem does this PR solve? #3978 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -206,7 +206,12 @@ class Canvas(ABC):
|
|||||||
waiting.append(c)
|
waiting.append(c)
|
||||||
continue
|
continue
|
||||||
yield "*'{}'* is running...🕞".format(self.get_compnent_name(c))
|
yield "*'{}'* is running...🕞".format(self.get_compnent_name(c))
|
||||||
ans = cpn.run(self.history, **kwargs)
|
try:
|
||||||
|
ans = cpn.run(self.history, **kwargs)
|
||||||
|
except Exception as e:
|
||||||
|
logging.exception(f"Canvas.run got exception: {e}")
|
||||||
|
self.path[-1].append(c)
|
||||||
|
raise e
|
||||||
self.path[-1].append(c)
|
self.path[-1].append(c)
|
||||||
ran += 1
|
ran += 1
|
||||||
|
|
||||||
@ -228,20 +233,12 @@ class Canvas(ABC):
|
|||||||
switch_out = cpn["obj"].output()[1].iloc[0, 0]
|
switch_out = cpn["obj"].output()[1].iloc[0, 0]
|
||||||
assert switch_out in self.components, \
|
assert switch_out in self.components, \
|
||||||
"{}'s output: {} not valid.".format(cpn_id, switch_out)
|
"{}'s output: {} not valid.".format(cpn_id, switch_out)
|
||||||
try:
|
for m in prepare2run([switch_out]):
|
||||||
for m in prepare2run([switch_out]):
|
yield {"content": m, "running_status": True}
|
||||||
yield {"content": m, "running_status": True}
|
|
||||||
except Exception as e:
|
|
||||||
logging.exception("Canvas.run got exception")
|
|
||||||
raise e
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
try:
|
for m in prepare2run(cpn["downstream"]):
|
||||||
for m in prepare2run(cpn["downstream"]):
|
yield {"content": m, "running_status": True}
|
||||||
yield {"content": m, "running_status": True}
|
|
||||||
except Exception as e:
|
|
||||||
logging.exception("Canvas.run got exception")
|
|
||||||
raise e
|
|
||||||
|
|
||||||
if ran >= len(self.path[-1]) and waiting:
|
if ran >= len(self.path[-1]) and waiting:
|
||||||
without_dependent_checking = waiting
|
without_dependent_checking = waiting
|
||||||
|
|||||||
@ -64,7 +64,7 @@ class ExeSQL(ComponentBase, ABC):
|
|||||||
self._loop += 1
|
self._loop += 1
|
||||||
|
|
||||||
ans = self.get_input()
|
ans = self.get_input()
|
||||||
ans = "".join(ans["content"]) if "content" in ans else ""
|
ans = "".join([str(a) for a in ans["content"]]) if "content" in ans else ""
|
||||||
ans = re.sub(r'^.*?SELECT ', 'SELECT ', repr(ans), flags=re.IGNORECASE)
|
ans = re.sub(r'^.*?SELECT ', 'SELECT ', repr(ans), flags=re.IGNORECASE)
|
||||||
ans = re.sub(r';.*?SELECT ', '; SELECT ', ans, flags=re.IGNORECASE)
|
ans = re.sub(r';.*?SELECT ', '; SELECT ', ans, flags=re.IGNORECASE)
|
||||||
ans = re.sub(r';[^;]*$', r';', ans)
|
ans = re.sub(r';[^;]*$', r';', ans)
|
||||||
|
|||||||
Reference in New Issue
Block a user