mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-25 09:53:29 +08:00
fix: stabilize knowledge compilation navigation updates (#17345)
This commit is contained in:
@@ -649,6 +649,22 @@ class InfinityConnection(InfinityConnectionBase):
|
||||
if k in new_value:
|
||||
del new_value[k]
|
||||
|
||||
# The Infinity Python client inspects value[0] for list values
|
||||
# while building an update expression. An empty list therefore
|
||||
# raises IndexError before the request reaches Infinity. Keep
|
||||
# JSON and keyword-list columns clearable, but do not send empty
|
||||
# values for other columns (for example, an empty vector returned
|
||||
# by a partial row read).
|
||||
for k, v in list(new_value.items()):
|
||||
if not isinstance(v, list) or v:
|
||||
continue
|
||||
if k in _JSON_LIST_FIELDS:
|
||||
new_value[k] = json.dumps([], ensure_ascii=False)
|
||||
elif self.field_keyword(k):
|
||||
new_value[k] = ""
|
||||
else:
|
||||
del new_value[k]
|
||||
|
||||
remove_opt = {} # "[k,new_value]": [id_to_update, ...]
|
||||
if removeValue:
|
||||
col_to_remove = list(removeValue.keys())
|
||||
|
||||
Reference in New Issue
Block a user