Skip to content

Commit a2f14d5

Browse files
authored
fix BulkWriter.__init__ bug when it has object_class param input (#1107)
1 parent 2190cd9 commit a2f14d5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

beanie/odm/bulk.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ def __init__(
8484
self.object_class = object_class
8585
self.bypass_document_validation = bypass_document_validation
8686
self.comment = comment
87-
self._collection_name: str
87+
self._collection_name: Optional[str] = (
88+
object_class.get_collection_name() if object_class else None
89+
)
8890

8991
async def __aenter__(self) -> "BulkWriter":
9092
return self

0 commit comments

Comments
 (0)