Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-3493

Bulk Write InsertOne Should Be Parameter Of Collection Type

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 4.3.3
    • Affects Version/s: None
    • Component/s: None
    • None

      coll: Collection[MovieWithoutId] = client.test.test
      coll.bulk_write([InsertOne(Movie({"_id": ObjectId(), "name": "THX-1138", "year": 1971}))])
      

      Bulk Write does not type check the inserted type based on the type of the collection. The previous example should raise an error in MyPy but does not.

            Assignee:
            julius.park@mongodb.com Julius Park (Inactive)
            Reporter:
            julius.park@mongodb.com Julius Park (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: