fix: Encode Chinese characters with Unicode before querying to match the Unicode encoded Chinese characters in the db (#12337)

Co-authored-by: zhaoqingyu.1075 <zhaoqingyu.1075@bytedance.com>
This commit is contained in:
zhu-an 2025-01-03 19:12:48 +08:00 committed by GitHub
parent 7ed6485f86
commit a5fb59b17f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,7 +27,7 @@ class WorkflowAppService:
query = query.join(WorkflowRun, WorkflowRun.id == WorkflowAppLog.workflow_run_id)
if keyword:
keyword_like_val = f"%{args['keyword'][:30]}%"
keyword_like_val = f"%{keyword[:30].encode('unicode_escape').decode('utf-8')}%".replace(r"\u", r"\\u")
keyword_conditions = [
WorkflowRun.inputs.ilike(keyword_like_val),
WorkflowRun.outputs.ilike(keyword_like_val),