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

Tx stuff seems to have broken imports recently

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 3.0.0
    • 3.0.0-beta.3
    • library
    • None
    • 1

    Description

      The following seems like it should work:

      from couchbase_core.cluster import PasswordAuthenticator
      from couchbase.cluster import ClusterOptions
      from txcouchbase.cluster import TxCluster
      from twisted.internet import reactor
       
       
      def cb(resp):
          for r in resp.rows():
              print(r)
       
       
      cluster = TxCluster.connect('couchbase://10.143.194.101',
                                  ClusterOptions(PasswordAuthenticator('Administrator', 'password')))
      b = cluster.bucket('beer-sample')
      resp = b.view_query("beer", "brewery_beers", limit=10)
      resp.add_callback(cb)
       
      # shutdown reactor after 10 seconds
      reactor.callLater(10, reactor.stop)
      reactor.run()

      However, I now get:

      Traceback (most recent call last):
        File "txminimal.py", line 1, in <module>
          from couchbase_core.cluster import PasswordAuthenticator
        File "/Users/davidkelly/projects/gerrit/couchbase-python-client/couchbase_core/cluster.py", line 20, in <module>
          from .client import Client
        File "/Users/davidkelly/projects/gerrit/couchbase-python-client/couchbase_core/client.py", line 5, in <module>
          import couchbase.exceptions as E
        File "/Users/davidkelly/projects/gerrit/couchbase-python-client/couchbase/__init__.py", line 3, in <module>
          from .bucket import *
        File "/Users/davidkelly/projects/gerrit/couchbase-python-client/couchbase/bucket.py", line 1, in <module>
          from couchbase.management import CollectionManager, ViewIndexManager
        File "/Users/davidkelly/projects/gerrit/couchbase-python-client/couchbase/management/__init__.py", line 2, in <module>
          from .views import ViewIndexManager
        File "/Users/davidkelly/projects/gerrit/couchbase-python-client/couchbase/management/views.py", line 22, in <module>
          from couchbase_core.client import Client
      ImportError: cannot import name 'Client' from 'couchbase_core.client' (/Users/davidkelly/projects/gerrit/couchbase-python-client/couchbase_core/client.py)
      

      This used to work. I'm guessing that maybe a recent refactor broke this.

      Attachments

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

        Activity

          People

            Ellis.Breen Ellis Breen
            david.kelly David Kelly (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty