Good morning @Muhammad_Ashir,
I hope you’re having a great day!
Looking at the error, it seems there might be an issue in the logic, as you’re attempting to insert the same class again.
I recommend using the exists() function in the client to handle this dynamically.
col = client.collections.get("<COL_NAME>").exists()
if col:
print("Collection exists")
else:
print("Collection does not exist")
This way, you can check if the collection already exists before trying to create or insert data into it.
Additionally, there is check on objects which can be beneficial for you:
<VAR> = <COL_NAME>.data.exists(object_uuid)
Hope this helps!
Regards,
Mohamed Shahin,
Weaviate Support Engineer