Uploaded image for project: 'Couchbase Python Client Library'
  1. Couchbase Python Client Library
  2. PYCBC-1428

ViewOrdering Enum value incorrectly applied in bindings

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 4.1.1
    • None
    • None
    • None
    • 0

    Description

      The ViewOrdering Enum (see below) has its value compared to incorrect values in the bindings when making a view_request to send to the C++ client. Therefore the ordering is never set. The bindings should be updated to the correct comparison.

      class ViewOrdering(Enum):
          DESCENDING = 'true'
          ASCENDING = 'false'
      

      bindings:

          PyObject* pyObj_order = PyDict_GetItemString(op_args, "order");
          if (pyObj_order != nullptr) {
              auto order = std::string(PyUnicode_AsUTF8(pyObj_order));
              if (order.compare("ascending") == 0) {
                  req.order = couchbase::core::view_sort_order::ascending;
              } else if (order.compare("descending") == 0) {
                  req.order = couchbase::core::view_sort_order::descending;
              }
          }
      

      Ref discord: https://discord.com/channels/915294689681362954/915297904627941427/1042126398501965824

      Attachments

        Activity

          People

            jared.casey Jared Casey
            jared.casey Jared Casey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              PagerDuty