cloudant / python-cloudant

A Python library for Cloudant and CouchDB
Apache License 2.0
163 stars 55 forks source link

Use custom encoder (if provided) for all view `key` params not just `keys` #501

Closed mojito317 closed 3 years ago

mojito317 commented 3 years ago

Checklist

Description

Fixes https://github.com/cloudant/python-cloudant/issues/221#issuecomment-752424499

Approach

Used custom encoder at _py_to_couch_translate for endkey, key, and startkey parameters.

Schema & API Changes

endkey, key and startkey parameters will be encoded with the custom encoder.

Security and Privacy

Testing

Test that all_docs uses the custom encoder. Fixed test_valid_endkey, test_valid_key and test_valid_startkey with long type.

Monitoring and Logging

ricellis commented 3 years ago

Still needs a changes entry https://github.com/cloudant/python-cloudant/pull/501#pullrequestreview-676251324

but otherwise I'm ok with this

mojito317 commented 3 years ago

Still needs a changes entry #501 (review)

but otherwise I'm ok with this

Right, I added it in ab304b2.

mojito317 commented 3 years ago

Thanks for the review @emlaver and @ricellis! I'm on it to merge this.