basho / riak-python-client

The Riak client for Python.
Apache License 2.0
321 stars 183 forks source link

python3-protobuf is not compatible with protobuf #526

Open omamchich opened 7 years ago

omamchich commented 7 years ago

protobuf is one of the dependencies for google-cloud-bigquery

Once I do pip install google-cloud-bigquery it install protobuf. Then riak library stops working.

I always get the error like this: File "/usr/local/lib/python3.5/dist-packages/google/protobuf/descriptor.py", line 824, in new return _message.default_pool.AddSerializedFile(serialized_pb) TypeError: expected bytes, str found

The possible solution: seems like protobuf version 3.4 works fine with python 3. So maybe it would be better to use protobuf instead of python3-protobuf

mvaled commented 6 years ago

Would this be the responsible of:

Traceback (...)
  ...
  .tox/system/lib/python3.5/site-packages/kaircs/service/fs.py:288: in __setitem__
      self.registers.map.store()
  .tox/system/lib/python3.5/site-packages/riak/datatypes/datatype.py:165: in update
      self.bucket._client.update_datatype(self, **params)
  .tox/system/lib/python3.5/site-packages/riak/client/operations.py:1139: in update_datatype
      include_context=include_context)
  .tox/system/lib/python3.5/site-packages/riak/transports/tcp/transport.py:515: in update_datatype
      msg = codec.encode_update_datatype(datatype, **kwargs)
  .tox/system/lib/python3.5/site-packages/riak/codecs/pbuf.py:1241: in encode_update_datatype
      self.encode_dt_op(type_name, req, op)
  .tox/system/lib/python3.5/site-packages/riak/codecs/pbuf.py:633: in encode_dt_op
      self.encode_map_op(req.op.map_op, op)
  .tox/system/lib/python3.5/site-packages/riak/codecs/pbuf.py:662: in encode_map_op
      update.field.name = str_to_bytes(name)
  .tox/system/lib/python3.5/site-packages/riak/util.py:127: AttributeError
      return value.encode(encoding)
AttributeError: 'bytes' object has no attribute 'encode'
acehko commented 5 years ago

I have a similar issue. Did anyone find a workaround for this?

mvaled commented 5 years ago

@acehko

We had to vendorize the riak-python-client into our project and fix it. However, we'll looking for alternatives to RiakKV since it's really dead. We only fixed it for our project (https://github.com/merchise/kaircs).

acehko commented 5 years ago

@mvaled Thanks. We're also looking for an alternative, but it will be a while before we can completely migrate.

mvaled commented 5 years ago

@acehko Same here. Can you share your candidates list with us? So far, we have considered and discarded Voldemort. We have even implemented a proof-of-concept CRDTs in Python (https://github.com/merchise/xotl.crdt); because our distribution requirements are not the "usual" ones (we don't require more than one server in each datacenter, but we do require fast (nearest) access Europe and America).