Miserlou / NoDB

NoDB isn't a database.. but it sort of looks like one.
https://blog.zappa.io/posts/introducing-nodb-pythonic-data-store-s3
380 stars 45 forks source link

.all() not working #31

Closed joamatab closed 5 years ago

joamatab commented 5 years ago

Im using the latest version pip install git+https://github.com/Miserlou/NoDB.git

pip list | ag nodb
nodb                          0.4.0  

After the i run the example,

I tried to show all the values stored using nodb.all()

---------------------------------------------------------------------------
JSONDecodeError                           Traceback (most recent call last)
<ipython-input-3-9ca61584a6c9> in <module>
----> 1 nodb.all()

~/miniconda3/lib/python3.7/site-packages/nodb/__init__.py in all(self, metainfo)
    188             serialized = obj.get()["Body"].read()
    189             # deserialize and add to list
--> 190             deserialized_objects.append(self._deserialize(serialized))
    191 
    192         # sort by insert datetime

~/miniconda3/lib/python3.7/site-packages/nodb/__init__.py in _deserialize(self, serialized)
    236 
    237         obj = None
--> 238         deserialized = json.loads(serialized)
    239         return_me = {}
    240 

~/miniconda3/lib/python3.7/json/__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
    346             parse_int is None and parse_float is None and
    347             parse_constant is None and object_pairs_hook is None and not kw):
--> 348         return _default_decoder.decode(s)
    349     if cls is None:
    350         cls = JSONDecoder

~/miniconda3/lib/python3.7/json/decoder.py in decode(self, s, _w)
    338         end = _w(s, end).end()
    339         if end != len(s):
--> 340             raise JSONDecodeError("Extra data", s, end)
    341         return obj
    342 

JSONDecodeError: Extra data: line 1 column 3 (char 2)
bendog commented 5 years ago

.all() is in 0.5.0 not 0.4.0

dschofield commented 4 years ago

This is still an issue.

I've installed 0.5.1 from tag 0.5.1: pipenv install git+https://github.com/Miserlou/NoDB.git@0.5.1#egg=nodb or, locally from the 0.5.1 tarball.

(btw, the version in setup.py still shows 0.4.0)

nodb.all() returns the error

Traceback (most recent call last): File "", line 1, in File "/home/dschofield/clients/mdg/NoDB-0.5.1/nodb/init.py", line 202, in all deserialized_objects.append(self._deserialize(serialized)) File "/home/dschofield/clients/mdg/NoDB-0.5.1/nodb/init.py", line 252, in _deserialize deserialized = json.loads(serialized) File "/usr/local/lib/python3.6/json/init.py", line 354, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.6/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/lib/python3.6/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)