From 995090e7d44af8193a66b83fd15586ac623ad0a6 Mon Sep 17 00:00:00 2001 From: Vladislav Shepilov Date: Mon, 13 Jan 2025 11:53:17 +0300 Subject: [PATCH] fix: broken `bulk_write` after https://github.com/mongodb/motor/pull/300 --- mongomock_motor/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mongomock_motor/__init__.py b/mongomock_motor/__init__.py index e51ffb0..977310c 100644 --- a/mongomock_motor/__init__.py +++ b/mongomock_motor/__init__.py @@ -40,6 +40,8 @@ def decorator(cls): def make_wrapper(method_name): async def wrapper(self, *args, **kwargs): proxy_source = self.__dict__.get(f'_{cls.__name__}{source}') + if method_name == "bulk_write" and "comment" in kwargs: + kwargs.pop("comment") return getattr(proxy_source, method_name)(*args, **kwargs) return wrapper