Skip to content

[Bug]: 条件过滤表达式中出现字典格式的字符串时会报错 #2703

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
blackxer opened this issue Mar 19, 2025 · 0 comments
Open
1 task done
Labels
kind/bug Something isn't working

Comments

@blackxer
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

pymilvus/pymilvus/orm/iterator.py 第 375 行代码
filtered_pk_str = f'{self._pk_field_name} > "{self._next_id}"'

当 self._next_id 是一个字典格式的字符串时,比如 self._next_id = '{"name":"张三","school":"北大"}'

调用 collection.query_iterator() 迭代器会报如下错误:

pymilvus.exceptions.MilvusException: <MilvusException: (code=1100, message=failed to create query plan: cannot parse expression: ids > "{"name":"张三","school":"北大"}", error: invalid expression: ids > "{"name":"\u5f20\u4e09","school":"\u5317\u5927"}": invalid parameter)>

建议使用 json.dumps()
filtered_pk_str = f'{self._pk_field_name} > {json.dumps(self._next_id, ensure_ascii=True)}'

Expected Behavior

No response

Steps/Code To Reproduce behavior

Environment details

- Hardware/Softward conditions (OS, CPU, GPU, Memory):
- Method of installation (Docker, or from source):
- Milvus version (v0.3.1, or v0.4.0):
- Milvus configuration (Settings you made in `server_config.yaml`):

Anything else?

No response

@blackxer blackxer added the kind/bug Something isn't working label Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant