bucket = self.riak_client.bucket(metadata_key)data_array = [{key: x.encoded_data} for key, x in zip(keys, bucket.multiget(keys))]
The data returned by bucket.multiget(keys) has been confirmed to vary, but seems to be in order most of the time. One of my tests fails 1 / 15 because of thus.
Is this by design, or is it a bug, and if it's by design, how to I get data for multiple keys at once and keep the order of the outputs such that I have accurate key value pairs.
Here is blosc encoded data we can see that the order changes:
(Pdb) [x.encoded_data for x in bucket.multiget(keys)]
['\x02\x01\x03\x08\xa9\x00\x00\x00\xa8\x00\x00\x00\xb9\x00\x00\x00\x80\x02cnumpy.core.multiarray\n_reconstruct\nq\x01cnumpy\nndarray\nq\x02K\x00\x85U\x01b\x87Rq\x03(K\x01K\x05\x85cnumpy\ndtype\nq\x04U\x02i8K\x00K\x01\x87Rq\x05(K\x03U\x01<NNNJ\xff\xff\xff\xffJ\xff\xff\xff\xffK\x00tb\x89U(\x06\x00\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00tb.', '\x02\x01\x03\x08\xbc\x00\x00\x00\xb8\x00\x00\x00\xcc\x00\x00\x00\x80\x02cnumpy.core.multiarray\n_reconstruct\nq\x01cnumpy\nndarray\nq\x02K\x00\x85U\x01b\x87Rq\x03(K\x01K\x05\x85cnumpy\ndtype\nq\x04U\x02O8K\x00K\x01\x87Rq\x05(K\x03U\x01|NNNJ\xff\xff\xff\xffJ\xff\xff\xff\xffK?tb\x89]q\x06(X\x04\x00\x00\x00Asdaq\x07X\x05\x00\x00\x00Tescoq\x08X\x04\x00\x00\x00Asdaq\tX\x04\x00\x00\x00Aldiq\nX\x04\x00\x00\x00Asdaq\x0betb.']
(Pdb) [x.encoded_data for x in bucket.multiget(keys)]
['\x02\x01\x03\x08\xbc\x00\x00\x00\xb8\x00\x00\x00\xcc\x00\x00\x00\x80\x02cnumpy.core.multiarray\n_reconstruct\nq\x01cnumpy\nndarray\nq\x02K\x00\x85U\x01b\x87Rq\x03(K\x01K\x05\x85cnumpy\ndtype\nq\x04U\x02O8K\x00K\x01\x87Rq\x05(K\x03U\x01|NNNJ\xff\xff\xff\xffJ\xff\xff\xff\xffK?tb\x89]q\x06(X\x04\x00\x00\x00Asdaq\x07X\x05\x00\x00\x00Tescoq\x08X\x04\x00\x00\x00Asdaq\tX\x04\x00\x00\x00Aldiq\nX\x04\x00\x00\x00Asdaq\x0betb.', '\x02\x01\x03\x08\xa9\x00\x00\x00\xa8\x00\x00\x00\xb9\x00\x00\x00\x80\x02cnumpy.core.multiarray\n_reconstruct\nq\x01cnumpy\nndarray\nq\x02K\x00\x85U\x01b\x87Rq\x03(K\x01K\x05\x85cnumpy\ndtype\nq\x04U\x02i8K\x00K\x01\x87Rq\x05(K\x03U\x01<NNNJ\xff\xff\xff\xffJ\xff\xff\xff\xffK\x00tb\x89U(\x06\x00\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00tb.']
I have the following code:
keys
is always in a fixed orderbucket = self.riak_client.bucket(metadata_key)
data_array = [{key: x.encoded_data} for key, x in zip(keys, bucket.multiget(keys))]
The data returned by
bucket.multiget(keys)
has been confirmed to vary, but seems to be in order most of the time. One of my tests fails 1 / 15 because of thus.Is this by design, or is it a bug, and if it's by design, how to I get data for multiple keys at once and keep the order of the outputs such that I have accurate key value pairs.
Here is blosc encoded data we can see that the order changes: