fix: stabilize knowledge compilation navigation updates (#17345)

This commit is contained in:
buua436
2026-07-24 17:48:27 +08:00
committed by GitHub
parent 1f97823ee3
commit 2ba7ccecaf
12 changed files with 181 additions and 76 deletions

View File

@@ -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())