TinyDB version: 4.8.2
Python version: 3.13.3
There is a difference in behavior when a non-existent doc_id is passed:
table.get(doc_id=N) returns None
table.update(doc_ids=[N]) raises KeyError exception
table.remove(doc_ids=[N]) raises KeyError exception
All method should have consistent results, i.e., either all raising an exception, or all returning a value (None or an empty list).
Also, the KeyError is generally not mentioned in the documentation for these operations.
TinyDB version: 4.8.2
Python version: 3.13.3
There is a difference in behavior when a non-existent
doc_idis passed:table.get(doc_id=N)returnsNonetable.update(doc_ids=[N])raisesKeyErrorexceptiontable.remove(doc_ids=[N])raisesKeyErrorexceptionAll method should have consistent results, i.e., either all raising an exception, or all returning a value (
Noneor an empty list).Also, the
KeyErroris generally not mentioned in the documentation for these operations.