From 1da0f82468af7133099da2a58c4b6cf0cf2b40c7 Mon Sep 17 00:00:00 2001 From: Jim Pivarski Date: Fri, 2 Feb 2018 12:27:23 -0600 Subject: [PATCH] more explicit .tostring()s --- oamap/source/shelve.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/oamap/source/shelve.py b/oamap/source/shelve.py index 16d57bc..cc9cea2 100644 --- a/oamap/source/shelve.py +++ b/oamap/source/shelve.py @@ -211,8 +211,8 @@ def fromdata(self, key, value, schema=None, inferencelimit=None, partitionlimit= partitionlookup.append(arrays[generator.stops][0] - arrays[generator.starts][0], arrays.keys()) for n, x in arrays.items(): - self.dbm[_asbytes(self.ARRAY + partitionlookup.id2name(n, 0))] = x - self.dbm[_asbytes(self.ARRAY + dataset.partitioning.key)] = numpy.array(partitionlookup) + self.dbm[_asbytes(self.ARRAY + partitionlookup.id2name(n, 0))] = x.tostring() + self.dbm[_asbytes(self.ARRAY + dataset.partitioning.key)] = numpy.array(partitionlookup).tostring() self.dbm[_asbytes(self.DATASET + key)] = dataset.tojsonstring() @@ -232,8 +232,8 @@ def fromdata(self, key, value, schema=None, inferencelimit=None, partitionlimit= partitionlookup.append(numentries, arrays.keys()) for n, x in arrays.items(): - self.dbm[_asbytes(self.ARRAY + partitionlookup.id2name(n, partitionid))] = x - self.dbm[_asbytes(self.ARRAY + dataset.partitioning.key)] = numpy.array(partitionlookup) + self.dbm[_asbytes(self.ARRAY + partitionlookup.id2name(n, partitionid))] = x.tostring() + self.dbm[_asbytes(self.ARRAY + dataset.partitioning.key)] = numpy.array(partitionlookup).tostring() def __setitem__(self, key, value): self.fromdata(key, value)