Yeah! this time worked :) thanks! Any ideas when a new release for the
Python client coming with that bug fixed?

Thanks,
Alex

On Mon, Nov 17, 2014 at 2:02 AM, Sean Cribbs <s...@basho.com> wrote:

> Sorry, I made a mistake in the example. Try this:
>
> RiakObject(bucket._client, bucket, 'testkey').delete()
>
> On Sun, Nov 16, 2014 at 3:15 PM, Alex De la rosa <alex.rosa....@gmail.com>
> wrote:
>
>> Hi Sean,
>>
>> Seams that the workaround suggested hits the same error:
>>
>> Traceback (most recent call last):
>>   File "x.py", line 9, in <module>
>>     RiakObject(bucket, 'testkey').delete()
>>   File "/usr/local/lib/python2.7/dist-packages/riak/riak_object.py", line
>> 335, in delete
>>     timeout=timeout)
>>   File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line 539,
>> in delete
>>     return self.new(key).delete(**kwargs)
>> AttributeError: 'Map' object has no attribute 'delete'
>>
>> Thanks,
>> Alex
>>
>> On Sun, Nov 16, 2014 at 8:02 PM, Sean Cribbs <s...@basho.com> wrote:
>>
>>> Hi Alex,
>>>
>>> That's a bug in the Python client. There's an existing issue on the repo
>>> for it: https://github.com/basho/riak-python-client/issues/365
>>>
>>> In the meantime, here's a workaround:
>>>
>>> from riak.riak_object import RiakObject
>>>
>>> RiakObject(bucket, 'testkey').delete()
>>>
>>> Sorry for the inconvenience.
>>>
>>> On Sat, Nov 15, 2014 at 5:54 PM, Alex De la rosa <
>>> alex.rosa....@gmail.com> wrote:
>>>
>>>> Hi there,
>>>>
>>>> I created an index and a MAP bucket-type in the following way:
>>>>
>>>> curl -XPUT "http://x.x.x.x:8098/search/index/ix_users";
>>>> riak-admin bucket-type create tp_users '{"props":
>>>> {"allow_mult":true,"search_index":"ix_users","datatype":"map"}}'
>>>> riak-admin bucket-type activate tp_users
>>>>
>>>> Then I saved some data and is working fine; but when I try to delete a
>>>> key, I get a nasty error; what am I doing wrong?:
>>>>
>>>> import riak
>>>>
>>>> client = riak.RiakClient(protocol = 'pbc', nodes = [{'host': 'x.x.x.x',
>>>> 'http_port': 8098, 'pb_port': 8087}])
>>>> bucket = client.bucket_type('tp_users').bucket('users')
>>>> bucket.delete('testkey')
>>>>
>>>> Output of the script:
>>>>
>>>> Traceback (most recent call last):
>>>>   File "x.py", line 6, in <module>
>>>>     bucket.delete('testkey')
>>>>   File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line
>>>> 539, in delete
>>>>     return self.new(key).delete(**kwargs)
>>>> AttributeError: 'Map' object has no attribute 'delete'
>>>>
>>>> This are my riak and python client versions:
>>>>
>>>> ~ # pip show riak
>>>> ---
>>>> Name: riak
>>>> Version: 2.1.0
>>>> Location: /usr/local/lib/python2.7/dist-packages
>>>> Requires: riak-pb, pyOpenSSL
>>>>
>>>> ~ # riak version
>>>> 2.0.2
>>>>
>>>> Thanks,
>>>> Alex
>>>>
>>>> _______________________________________________
>>>> riak-users mailing list
>>>> riak-users@lists.basho.com
>>>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>>>
>>>>
>>>
>>>
>>> --
>>> Sean Cribbs <s...@basho.com>
>>> Sr. Software Engineer
>>> Basho Technologies, Inc.
>>> http://basho.com/
>>>
>>
>>
>
>
> --
> Sean Cribbs <s...@basho.com>
> Sr. Software Engineer
> Basho Technologies, Inc.
> http://basho.com/
>
_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to