V4 client.close() does not exist?

Description

v4client = weaviate.connect_to_local(
    host = "localhost",
    port = 8077) 

try:
    collection = v4client.collections.get(schema_name)
    
    response = collection.query.near_vector(
        near_vector=searchvector,
        distance=0.75,
        limit=5
    )
    
    for o in response.objects:
        print(o.properties)
finally:
    v4client.close()

--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[11], [line 17](vscode-notebook-cell:?execution_count=11&line=17) [15](vscode-notebook-cell:?execution_count=11&line=15) print(o.properties) [16](vscode-notebook-cell:?execution_count=11&line=16) finally: ---> [17](vscode-notebook-cell:?execution_count=11&line=17) v4client.close() AttributeError: 'WeaviateClient' object has no attribute 'close'

Server Setup Information

  • Weaviate Server Version: image: semitechnologies/weaviate:1.23.2
  • Deployment: docker
  • Multi Node? no
  • Client Language and Version: python - v4.4b6

Any additional Information

Following the V4 example on page:
https://weaviate.io/developers/weaviate/api/graphql/search-operators#example

you are on an old beta - please update to the latest version.

Thank you @Dirk, which meant upgrading the python client to 4.4.4 which in turn meant upgrading the server to 1.23.7 and also change my custom vectorizing function so that it returned a List and not a numpy array like it silently did until now.

1 Like