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

Cannot import _QUERY_OPTIONS on Pymongo 4.9

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • 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?

      Detailed steps to reproduce the problem?

      As of today, pymongo package was updated to 4.9 on pip, and the following error started to show up:

      ImportError: cannot import name '_QUERY_OPTIONS' from 'pymongo.cursor' 

      The change history on GitHub still shows version 4.8, so I can't see if anything changed regarding _QUERY_OPTIONS.

      Steps:

      • Install pymongo 4.9 using pip:
        • pip install pymongo
      • Try to import _QUERY_OPTIONS:
        • python3 -c "from pymongo.cursor import _QUERY_OPTIONS"

      Definition of done: what must be done to consider the task complete?

      _QUERY_OPTIONS is imported, or change history shows the changes that affects  _QUERY_OPTIONS.

      The exact Python version used, with patch level:

      $ python -c "import sys; print(sys.version)"

      The exact version of PyMongo used, with patch level:

      $ python -c "import pymongo; print(pymongo.version); print(pymongo.has_c())"

      $ python3 -c "import sys; print(sys.version)"
      3.12.5 (main, Aug 23 2024, 00:00:00) [GCC 14.2.1 20240801 (Red Hat 14.2.1-1)]

      Describe how MongoDB is set up. Local vs Hosted, version, topology, load balanced, etc.

      The operating system and version (e.g. Windows 7, OSX 10.8, ...)

      Fedora 40

      Web framework or asynchronous network library used, if any, with version (e.g. Django 1.7, mod_wsgi 4.3.0, gevent 1.0.1, Tornado 4.0.2, ...)

      Security Vulnerabilities

      If you’ve identified a security vulnerability in a driver or any other MongoDB project, please report it according to the instructions here

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            wrampazz@redhat.com WIllian Rampazzo
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: