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

Type annotation is incorrect in binary.py

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 4.11
    • Affects Version/s: None
    • Component/s: None
    • None
    • Python Drivers
    • 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?

      Context

      We want to start using binary for some of our mongo database fields but the type annotation for binary.py is incorrect. Specifically, 

      https://github.com/mongodb/mongo-python-driver/blob/8fa6750a7e077c33f304e72f3e17467ced9cd224/bson/binary.py#L415

      https://github.com/mongodb/mongo-python-driver/blob/8fa6750a7e077c33f304e72f3e17467ced9cd224/bson/binary.py#L408

      In these two lines, there is a reference to `list[ int, float ]` when it should be `list[ int | float]`. 

      Definition of done

      The types should be fixed as suggested. 

      Pitfalls

      People who depend on the existing implementation of the type might break, but those should be fixed as well. 

            Assignee:
            jib.adegunloye@mongodb.com Jib Adegunloye
            Reporter:
            ezeugo@amigo.ai Ezeugo Anukem
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: