mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-06 06:53:12 +00:00
DynamoDB has a rather baroque definition of numbers, and in particular it does *not* allow numeric attributes to be set to infinity or NaN. Although I did check invalid numbers in the past, manually, I was never able to write a unit test for this in the past - because the boto3 library catches such errors on the client side, and prevents the test from sending broken requests to the server. So in this patch, I finally came up with a solution - a context manager client_no_transform() which yields a client which does NOT do any transformation or validation on the request's parameters, allowing us to use boto3 to create improper requests - and test the server's handling of them. The test in this patch passes - it did not discover a new bug, but it is a useful regression test and the client_no_transform() trick can be used in more error-case tests which until now we were unable to write. Signed-off-by: Nadav Har'El <nyh@scylladb.com> Message-Id: <20211004161809.520236-1-nyh@scylladb.com>