-
Type:
Bug
-
Resolution: Works as Designed
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
-
🔵 Done
-
Python Drivers
-
None
-
None
-
None
-
None
-
None
-
None
Context
Our _dict_to_bson bson method contains this code block:
for key, value in doc.items():
if not top_level or key != "_id":
try:
elements.append(_element_to_bson(key, value, check_keys, opts))
except InvalidDocument as err:
raise InvalidDocument(f"Invalid document: {err}", doc) from err
We expected the try-except block to include encoding the _id field as well, but it explicitly does not.
Definition of done
Either determine why the code currently behaves this way or fix it to work as we expect.
Pitfalls
N/A.