milvus_query_failureTier 1 · 70% confidence

infrastructure-milvus-query-failure-query-on-milvusvectorstore-with-node-ids-populated-c8e1642f

agent: infrastructure

When does this happen?

IF Query on MilvusVectorStore with node_ids populated but filters empty (None) causes AttributeError because the code attempts to join list objects in 'expr' with FilterCondition from query.filters, assuming filters is not None.

How others solved it

THEN Update the query method to handle the case where filters is None. When filters is None or empty, construct the expression using only node_ids if provided. In the MilvusVectorStore.query method, add a guard: if query.filters is None or not query.filters.filters, then only use node_ids to build the filter expression instead of attempting to combine with FilterCondition.

# Inside MilvusVectorStore.query method:
if query.filters is not None and query.filters.filters:
    expr.extend(_to_milvus_filter(query.filters))
else:
    if query.node_ids:
        expr_list = ['"' + entry + '"' for entry in query.node_ids]
        expr.append(f"{MILVUS_ID_FIELD} in [{','.join(expr_list)}]")

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics