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

Python SDK connection object host list usage not clear

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0-dp1
    • Component/s: None
    • Security Level: Public
    • Labels:
      None

      Description

      http://www.couchbase.com/autodocs/couchbase-python-client-1.2.0/html/api/couchbase.html
      http://pythonhosted.org/couchbase/api/couchbase.html

      The documentation for the connection object has the following ->
      host (string or list) – the hostname or IP address of the node. This can be a list or tuple of multiple nodes; the nodes can either be simple strings, or (host, port) tuples (in which case the port parameter from the method arguments is ignored).

      ===========

      It wasn't clear to me how the sdk expected the list of hosts to be provided, only by reading the C client could I see it was expecting a semi-colon separated list of hosts. I would recommend that the documentation specifically says a semi-colon separated list of hosts and provide an example which has a list of hosts. Square bracket standard python lists also seem to work. Perhaps these can also be shown as an example.

      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        Hide
        ingenthr Matt Ingenthron added a comment -

        Ian: Thanks so much for the feedback on the docs. I've seen these across a number of the projects and it's very helpful to us to get this kind of feedback.

        Show
        ingenthr Matt Ingenthron added a comment - Ian: Thanks so much for the feedback on the docs. I've seen these across a number of the projects and it's very helpful to us to get this kind of feedback.
        Hide
        mnunberg Mark Nunberg added a comment -

        Actually the intent here is to provide a natural "List" for Python containing various host-port pairs. The semicolon is only supposed to accidentally work, because libcouchbase happens to handle it, and the client, internally, joins the various hosts in the list using the semicolon. I will try to offer some examples for how this can be done.

        Show
        mnunberg Mark Nunberg added a comment - Actually the intent here is to provide a natural "List" for Python containing various host-port pairs. The semicolon is only supposed to accidentally work, because libcouchbase happens to handle it, and the client, internally, joins the various hosts in the list using the semicolon. I will try to offer some examples for how this can be done.
        Show
        mnunberg Mark Nunberg added a comment - http://review.couchbase.org/#/c/36760/
        Hide
        mnunberg Mark Nunberg added a comment -

        Implicitly fixed in the DP with the connection string

        Show
        mnunberg Mark Nunberg added a comment - Implicitly fixed in the DP with the connection string

          People

          • Assignee:
            mnunberg Mark Nunberg
            Reporter:
            ianmccloy Ian McCloy
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes