Переглянути джерело

Fix:valueERROR when file is optional but not exist value (#9414)

### What problem does this PR solve?

when begin component has optional file but not exist , it rase error

### Type of change

- [x] Bug Fix

Co-authored-by: Popmio <zhengyihao036@gamil.com>
tags/v0.20.2
Popmio 2 місяці тому
джерело
коміт
e845d5f9f8
Аккаунт користувача з таким Email не знайдено
1 змінених файлів з 4 додано та 1 видалено
  1. 4
    1
      agent/component/begin.py

+ 4
- 1
agent/component/begin.py Переглянути файл

@@ -39,7 +39,10 @@ class Begin(UserFillUp):
def _invoke(self, **kwargs):
for k, v in kwargs.get("inputs", {}).items():
if isinstance(v, dict) and v.get("type", "").lower().find("file") >=0:
v = self._canvas.get_files([v["value"]])
if v.get("optional") and v.get("value", None) is None:
v = None
else:
v = self._canvas.get_files([v["value"]])
else:
v = v.get("value")
self.set_output(k, v)

Завантаження…
Відмінити
Зберегти