weaviate / weaviate/weaviate-python-client
[bug] async client: query list value type mis-match
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 227
- Forks
- 151
- Avg merge
- 3d 14h
- Merged PRs (30d)
- 11
Description
When querying text with the async client, there is a bug parsing list-type values
it occurs in your __deserialize_non_ref_prop method on the base_executor file. There is code to escape to a version + 1.25 list parser that is breaking (seems like the async client is still returning the version expected in the < 1.25 version)
if value.HasField("list_value"):
return (
self.__deserialize_list_value_prop_125(value.list_value)
if self._connection._weaviate_version.is_at_least(1, 25, 0)
else self.__deserialize_list_value_prop_123(value.list_value)
)
If i manually edit the package to always use __deserialize_list_value_prop_123, then the async query works, so I assume the fix here is to update the async client response handlers
for reference, here is a simplified look at how im calling it
self.weaviate_async_client = weaviate.use_async_with_weaviate_cloud(
cluster_url=os.getenv('WEAVIATE_HIGH_PERFORMANCE_CLUSTER_URL'),
auth_credentials=weaviate.auth.AuthApiKey(os.getenv('WEAVIATE_HIGH_PERFORMANCE_API_KEY')),
skip_init_checks=True,
headers={
"X-OpenAI-Api-Key": os.getenv('OPENAI_API_KEY'),
"X-Cohere-Api-Key": os.getenv('COHERE_API_KEY'),
"X-VoyageAI-Api-Key": os.getenv('VOYAGE_API_KEY')
}
)
collection_name = 'Posts'
collection = agent.database.weaviate_async_client.collections.get(collection_name)
await agent.database.weaviate_async_client.connect()
search_query = "decentralized training"
results = await collection.query.near_text(query=search_query, limit=10) # -- error
python version: 3.11
weaviate version: weaviate-client-4.16.10
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in weaviate/collections/queries/base_executor.py at __deserialize_non_ref_prop and compare the async response handling with the version-specific list parsers shown in the issue. Reproduce the near_text query using list-type values and verify that the async client parses the response without the type mismatch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100