Issue 169 in couchdb-python: ViewResults with non-dict values raise a TypeError

3 views
Skip to first unread message

couchdb...@googlecode.com

unread,
Mar 3, 2011, 12:19:30 PM3/3/11
to couchdb...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 169 by matthewt...@gmail.com: ViewResults with non-dict values
raise a TypeError
http://code.google.com/p/couchdb-python/issues/detail?id=169

What steps will reproduce the problem?
1. Create a ViewResults object from a view where the values are something
that isn't a dict - ie. string, int, etc.
2. Attempt to iterate over the results.

What is the expected output? What do you see instead?
I should be able to define a view that contains non-dict values and access
those values at row['value']. Instead, I get a TypeError

What version of the product are you using? On what operating system?
Mercurial

Please provide any additional information below.
I've attached a patch that modifies the _wrap_row classmethod to handle
instances where the row value is non-dict. Where the value is not a dict,
the except TypeError block is executed, which sets the data value to the
value of the non-dict row.

Attachments:
mapping-patch.diff 464 bytes

couchdb...@googlecode.com

unread,
Mar 3, 2011, 3:21:18 PM3/3/11
to couchdb...@googlegroups.com

Comment #1 on issue 169 by daevaorn: ViewResults with non-dict values raise
a TypeError
http://code.google.com/p/couchdb-python/issues/detail?id=169

Don't try to wrap Mappin with non dict value. Just use raw views api
(db.view) instead of mappings in this case.

couchdb...@googlecode.com

unread,
Jul 15, 2014, 3:37:03 AM7/15/14
to couchdb...@googlegroups.com

Comment #2 on issue 169 by djc.ochtman: ViewResults with non-dict values
This issue has been migrated to GitHub. Please continue discussion here:

https://github.com/djc/couchdb-python/issues/169

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
Reply all
Reply to author
Forward
0 new messages