KeyError accessing results from Document.view when reduce=False and value is dictionary
- Dominant language
- Python
- Stars
- 263
- Forks
- 90
- PR merge metrics
- No merged PRs in 30d
Description
Additional details at mailing list post:
https://groups.google.com/forum/?fromgroups#!topic/couchdbkit/OldePEe3uxU
Ubuntu 12.04
Couchdbkit 0.6.2
Couchdb 1.2
Django 1.5.dev17942
Python 2.7.3
/home/vincent/temp/greeting/views/all contains a file called map.js with the contents:
function(doc) { emit( 1, {'a': 1, 'b': 2} ); }
There is no reduce.js (so reduce=False is unnecessary)
Reproduce via the following interactive Django Python session:
$ ./manage.py shell
```
from couchdbkit import *
class Greeting(Document):
def __unicode__(self):
return None
server = Server()
db = server.get_or_create_db("greeting")
Greeting.set_db(db)
greet = Greeting()
greet.test = "test"
greet.save()
from couchdbkit.designer import push
push('/home/vincent/temp/greeting', db)
greets = Greeting.view('greeting/all')
greets.count() # returns 1
greets.first()
```
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/couchdbkit/client.py", line 930, in first
return list(self)[0]
File "/usr/local/lib/python2.7/dist-packages/couchdbkit/client.py", line 920, in iterator
yield wrapper(row)
File "/usr/local/lib/python2.7/dist-packages/couchdbkit/client.py", line 901, in row_wrapper
return schema(data)
File "/usr/local/lib/python2.7/dist-packages/couchdbkit/schema/util.py", line 29, in wrap
cls = classes[doc_type]
KeyError: None
Via the URL http://127.0.0.1:5984/greeting/_design/greeting/_view/all Couchdb gives the output
> {"total_rows":1,"offset":0,"rows":[{"id":"49ca1d5086e0c7eb36471d2e621f5a49","key":1,"value":{"a":1,"b":2}}]}
This is the line from the Couchdb log for the Couchdbkit query
> [info] [<0.12793.16>] 127.0.0.1 - - GET /greeting/_design/greeting/_view/all?wrap_doc=true 200
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.