#contributions

Resolving Typo in Python Language Documentation

TLDR Ankur pointed out a typo in the Python documentation. Jason at first disagreed but then recognized the mistake, promising to fix it.

Powered by Struct AI
6
28mo
Solved
Join the chat
Sep 14, 2021 (28 months ago)
Ankur
Photo of md5-655ed51d776c2889808ccdc3dff7d665
Ankur
09:37 PM
Hey,
Small typo
https://typesense.org/docs/0.21.0/api/documents.html#delete-documents
client.collections['companies'].documents.delete_({'filter_by': 'num_employees:>100'})

the _ is the typo. Language is python.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
09:38 PM
That's actually intended, since delete is a reserved keyword in python
Ankur
Photo of md5-655ed51d776c2889808ccdc3dff7d665
Ankur
10:00 PM
client.collections['content'].documents.delete_({'filter_by': 'client_id=1'})
    ...: 
    ...: 
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-40-dd38c25a6140> in <module>
----> 1 client.collections['content'].documents.delete_({'filter_by': 'client_id=1'})
      2 

AttributeError: 'Documents' object has no attribute 'delete_'

Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
10:03 PM
Oh my bad. I was actually thinking about import_ which is a reserved keyword, so we had to an _.

You're right delete_ is indeed a typo, will fix it.
Ankur
Photo of md5-655ed51d776c2889808ccdc3dff7d665
Ankur
10:03 PM
Thank you Jason. 🙂 🙏
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
10:03 PM
Thank you!