liuhua liuhua Kevin Hu commited on
Commit
4597c28
·
1 Parent(s): bf67acc

Fix enable/disable bug (#3662)

Browse files

### What problem does this PR solve?

Fix enable/disable bug #3628

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

---------

Co-authored-by: liuhua <[email protected]>
Co-authored-by: Kevin Hu <[email protected]>

Files changed (1) hide show
  1. rag/utils/es_conn.py +1 -1
rag/utils/es_conn.py CHANGED
@@ -294,7 +294,7 @@ class ESConnection(DocStoreConnection):
294
  f"Condition `{str(k)}={str(v)}` value type is {str(type(v))}, expected to be int, str or list.")
295
  scripts = []
296
  for k, v in newValue.items():
297
- if not isinstance(k, str) or not v:
298
  continue
299
  if isinstance(v, str):
300
  scripts.append(f"ctx._source.{k} = '{v}'")
 
294
  f"Condition `{str(k)}={str(v)}` value type is {str(type(v))}, expected to be int, str or list.")
295
  scripts = []
296
  for k, v in newValue.items():
297
+ if (not isinstance(k, str) or not v) and k != "available_int":
298
  continue
299
  if isinstance(v, str):
300
  scripts.append(f"ctx._source.{k} = '{v}'")