Open rramanadham opened 10 years ago
Can you post the code block that raises this error?
Here is my code-
I call createDesignDocForErrors() :
def createDesignDocForErrors():
design = db.design(errors_view)
resp = design.put(params={
"_id":"_design/errors",
"language": "javascript",
"views":
{
"by_test_id": {
#"map": "function(doc) { if (doc.type == 'error') emit(doc.test_id, doc.errors) }"
"map": "function(doc) { if (doc.type == 'error') emit(doc.test_id, doc.error_count) }",
"reduce" : "_sum"
},
#http://10.247.32.72:5984/longevity/_design/errors/_view/by_testid_starttime?group=true
"by_testid_starttime": {
"map": "function(doc) { if (doc.type == 'error') emit([doc.test_id,doc.start_time], doc.error_count) }",
"reduce" : "function(keys, values) {return (values[0])}"
}
}
})
The last piece of code that gets executed before it returns to the caller- createDesignDocForErrors() is from cloudant/document.py at the line- "deletion = self.delete(self, doc['_rev'])"
def __del__(self):
"""
Shortcut to synchronously deleting the document from the database.
For example:
del db['docKey']
"""
response = self.get()
# block until result if the object is using async/is a future
if hasattr(response, 'result'):
response = response.result()
response.raise_for_status()
doc = response.json()
deletion = self.delete(self, doc['_rev'])
# block until result if the object is using async/is a future
if hasattr(deletion, 'result'):
deletion = deletion.result()
deletion.raise_for_status()
Where are you calling deletion = self.delete(self, doc['_rev'])
? The line you posted doesn't call __del__
.
I don't know why delete is called. I don't call it. However, I was suggested that cloudant 0.5.9 has the problem fixed. Just ran a test after I upgraded cloudant to 0.5.9 and I no more see the error.
Ah, well, hooray!
Hi,
I am using cloudant0.5.8 and python3.3, couchdb 1.5.1 on suse linux. and I get the error when ever I create a document. The document does get created, but i cant avoid the error.
I tried to debug the code, but i couldnt figure out.
Exception TypeError: TypeError('delete() takes 2 positional arguments but 3 were given',) in <bound method Design.del of <cloudant.design.Design object at 0x7f265f4f4dd0>> ignored
Can you help?
Thanks, Radhika