Incorrect return type annotation for find_one_and_* methods. Can be None

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Unknown
    • 4.16.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • 🔵 Done
    • Python Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      find_one_and_update's existing type hint makes the false claim that the method returns a _DocumentType. However, the docstring (correctly) tells us that the method "Returns ``None`` if no document matches the filter."

      The same is true of other find_one_and_* methods.

      Definition of done

      A PR has been submitted by Cal Jacobson (cj81499). We have reviewed. This issue is here for posterity and to follow our new PR template process.

            Assignee:
            Casey Clements
            Reporter:
            Casey Clements
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: