LGTM added a couple comments to the PR, but they can be refuted or ignored.
So a few questions for Adam,
If a user passes in values for the custom_payload that are not valid, what sort of exceptions are expected from the driver. I'm seeing some behavior that I'm not sure is 100% right. For instance, when when I pass in a map of size > uShort I receive the following
File "/Users/gregbestland/git/python-driver/cassandra/cluster.py", line 3087, in result
raise self._final_exception
NoHostAvailable: ('Unable to complete the operation against any hosts', {<Host: 127.0.0.3 dc1>: error("'H' format requires 0 <= number <= 65535",), <Host: 127.0.0.2 dc1>: error("'H' format requires 0 <= number <= 65535",), <Host: 127.0.0.1 dc1>: error("'H' format requires 0 <= number <= 65535",)})
I just wanted to make sure that this was expected.
If a user passes in values for the custom_payload that are not valid, what sort of exceptions are expected from the driver.
It's not really specified. The exception you show here is accurate, but probably a little vague. I'm on the fence about putting too much polish on this since it's such an esoteric feature. In this case, I could probably put some input validation that explains what the limitation is. It will raise ValueError if you're writing a test around it.