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

PyMongo sends "$comment" with distinct and count instead of "comment"

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.8
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Minor Change

      Observed this test failure when running with PyPy on DB version v4.1.9-89-g23ca771f76.

      UPDATE: this fails on CPython as well. We didn't see that failure in the linked evergreen build because the test is skipped when auth is enabled which was the case for that build.

      See the Evergreen build here.

      Failure: 

      [2019/03/21 07:52:19.475] ======================================================================
      [2019/03/21 07:52:19.475] ERROR [0.021s]: test_comment (test_cursor.TestCursor)
      [2019/03/21 07:52:19.475] ----------------------------------------------------------------------
      [2019/03/21 07:52:19.475] Traceback (most recent call last):
      [2019/03/21 07:52:19.475]   File "/data/mci/87ad79ce9157f2cecb43aebfdfbafdf4/src/test/__init__.py", line 410, in wrap
      [2019/03/21 07:52:19.475]     return f(*args, **kwargs)
      [2019/03/21 07:52:19.475]   File "/data/mci/87ad79ce9157f2cecb43aebfdfbafdf4/src/test/utils.py", line 497, in wrapper
      [2019/03/21 07:52:19.475]     return wrapped(*args, **kwargs)
      [2019/03/21 07:52:19.475]   File "/data/mci/87ad79ce9157f2cecb43aebfdfbafdf4/src/test/test_cursor.py", line 1252, in test_comment
      [2019/03/21 07:52:19.475]     self.db.test.find().comment('foo').distinct('type')
      [2019/03/21 07:52:19.475]   File "/data/mci/87ad79ce9157f2cecb43aebfdfbafdf4/src/pymongo/cursor.py", line 799, in distinct
      [2019/03/21 07:52:19.475]     key, session=self.__session, **options)
      [2019/03/21 07:52:19.475]   File "/data/mci/87ad79ce9157f2cecb43aebfdfbafdf4/src/pymongo/collection.py", line 2675, in distinct
      [2019/03/21 07:52:19.475]     collation=collation, session=session)["values"]
      [2019/03/21 07:52:19.475]   File "/data/mci/87ad79ce9157f2cecb43aebfdfbafdf4/src/pymongo/collection.py", line 245, in _command
      [2019/03/21 07:52:19.475]     retryable_write=retryable_write)
      [2019/03/21 07:52:19.475]   File "/data/mci/87ad79ce9157f2cecb43aebfdfbafdf4/src/pymongo/pool.py", line 579, in command
      [2019/03/21 07:52:19.475]     unacknowledged=unacknowledged)
      [2019/03/21 07:52:19.475]   File "/data/mci/87ad79ce9157f2cecb43aebfdfbafdf4/src/pymongo/network.py", line 150, in command
      [2019/03/21 07:52:19.475]     parse_write_concern_error=parse_write_concern_error)
      [2019/03/21 07:52:19.475]   File "/data/mci/87ad79ce9157f2cecb43aebfdfbafdf4/src/pymongo/helpers.py", line 155, in _check_command_response
      [2019/03/21 07:52:19.475]     raise OperationFailure(msg % errmsg, code, response)
      [2019/03/21 07:52:19.475] OperationFailure: BSON field 'distinct.$comment' is an unknown field.
      [2019/03/21 07:52:19.475] ----------------------------------------------------------------------
      

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            prashant.mital Prashant Mital (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: