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

Bulk write operations don't consider hint field in equality checks

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 4.6
    • Affects Version/s: None
    • Component/s: None
    • None

      PYTHON-2142 and PYTHON-2036 added hint support for various bulk operations like DeleteOne but they neglected to add hint to the equality and repr logic:

      def __repr__(self):
          return f"DeleteOne({self._filter!r}, {self._collation!r})". # what about self._hint?
      
      def __eq__(self, other: Any) -> bool:
          if type(other) == type(self):
              return (other._filter, other._collation) == (self._filter, self._collation)  # what about self._hint?
          return NotImplemented
      

      https://github.com/mongodb/mongo-python-driver/blob/0092b0af79378abf35b6db73a082ecb91af1d973/pymongo/operations.py#L100-L112

            Assignee:
            noah.stapp@mongodb.com Noah Stapp
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: