AssertionError while querying

Hi, I am getting the following error whenever I try to query from the collection.

I tried querying by bm25 search, vector search and also using fetch_objects() method. Couldn’t query by any means, getting the same error.

Traceback (most recent call last):
  File "D:\Weaviate\checking_connectivity.py", line 39, in <module>
    response = collection_name.query.fetch_objects(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Laptop\AppData\Local\Programs\Python\Python311\Lib\site-packages\weaviate\collections\queries\fetch_objects\query.py", line 76, in fetch_objects
    return self._result_to_query_return(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Laptop\AppData\Local\Programs\Python\Python311\Lib\site-packages\weaviate\collections\queries\base.py", line 350, in _result_to_query_return
    objects=[
            ^
  File "C:\Users\Laptop\AppData\Local\Programs\Python\Python311\Lib\site-packages\weaviate\collections\queries\base.py", line 351, in <listcomp>      
    self.__result_to_query_object(obj.properties, obj.metadata, options)
  File "C:\Users\Laptop\AppData\Local\Programs\Python\Python311\Lib\site-packages\weaviate\collections\queries\base.py", line 229, in __result_to_query_object
    self.__parse_nonref_properties_result(props.non_ref_props)
  File "C:\Users\Laptop\AppData\Local\Programs\Python\Python311\Lib\site-packages\weaviate\collections\queries\base.py", line 196, in __parse_nonref_properties_result
    return {
           ^
  File "C:\Users\Laptop\AppData\Local\Programs\Python\Python311\Lib\site-packages\weaviate\collections\queries\base.py", line 197, in <dictcomp>      
    name: self.__deserialize_non_ref_prop(value)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Laptop\AppData\Local\Programs\Python\Python311\Lib\site-packages\weaviate\collections\queries\base.py", line 181, in __deserialize_non_ref_prop
    assert value.HasField("phone_value")
AssertionError

Hi! Can you share the query and this collections definition for the properties?

It seems that it’s not able to get/validate the phone_value property.

Thanks!

There is no property named 'phone_value' in the collection definition.

The query how I use to fetch the objects is as follows

collection.query.fetch_objects(
filters = Filter.by_property(‘id_’).contains_any([‘id_01’])
)

However, I am facing the same issue even trying to read all the objects using iterator() method.

Can you share the collection definition?

Also, is this something you can reproduce on a clean cluster?

Thanks!

Yeah I face the same issue on a new cluster too.

I have used Auto schema to define the properties in the collection. The collection definition is as follows

_CollectionConfig(name='<collection_name>',
description=None,
generative_config=None,
inverted_index_config=_InvertedIndexConfig(bm25=_BM25Config(b=0.75, k1=1.2),
cleanup_interval_seconds=60,
index_null_state=False,
index_property_length=False,
index_timestamps=False,
stopwords=_StopwordsConfig(preset=<StopwordsPreset.EN: 'en'>, additions=None, removals=None)),
multi_tenancy_config=_MultiTenancyConfig(enabled=False),
properties=[
    _Property(name='name', description="This property was generated by Weaviate's auto-schema feature on Fri Mar 15 06:09:41 2024", data_type=<DataType.TEXT: 'text'>, index_filterable=True, index_searchable=True, nested_properties=None, tokenization=<Tokenization.WORD: 'word'>, vectorizer_config=None, vectorizer='none'),
    _Property(name='brand', description="This property was generated by Weaviate's auto-schema feature on Fri Mar 15 06:09:41 2024", data_type=<DataType.TEXT: 'text'>, index_filterable=True, index_searchable=True, nested_properties=None, tokenization=<Tokenization.WORD: 'word'>, vectorizer_config=None, vectorizer='none'),
    _Property(name='qty', description="This property was generated by Weaviate's auto-schema feature on Fri Mar 15 06:09:41 2024", data_type=<DataType.TEXT: 'text'>, index_filterable=True, index_searchable=True, nested_properties=None, tokenization=<Tokenization.WORD: 'word'>, vectorizer_config=None, vectorizer='none'),
    ...
],
references=[],
replication_config=_ReplicationConfig(factor=1),
reranker_config=None,
sharding_config=_ShardingConfig(virtual_per_physical=128, desired_count=1, actual_count=1, desired_virtual_count=128, actual_virtual_count=128, key='_id', strategy='hash', function='murmur3'),
vector_index_config=_VectorIndexConfigHNSW(quantizer=_PQConfig(bit_compression=False, segments=128, centroids=256, training_limit=100000, encoder=_PQEncoderConfig(type_=<PQEncoderType.KMEANS: 'kmeans'>, distribution=<PQEncoderDistribution.LOG_NORMAL: 'log-normal'>)), cleanup_interval_seconds=300, distance_metric=<VectorDistances.COSINE: 'cosine'>, dynamic_ef_min=100, dynamic_ef_max=500, dynamic_ef_factor=8, ef=-1, ef_construction=128, flat_search_cutoff=40000, max_connections=64, skip=False, vector_cache_max_objects=1000000000000),
vector_index_type=<VectorIndexType.HNSW: 'hnsw'>,
vectorizer_config=None,
vectorizer=<Vectorizers.NONE: 'none'>
)

Which versions are you using? In case you are using weaviate >= 1.24 you need to update your python client to at least 4.5 (see here: Python | Weaviate - Vector Database)

1 Like