taoensso / faraday

Amazon DynamoDB client for Clojure
https://www.taoensso.com/faraday
Eclipse Public License 1.0
238 stars 84 forks source link

Add support empty string and binary vals #150

Closed smithtim closed 3 years ago

smithtim commented 3 years ago

As of May 2020, DynamoDB supports empty strings: https://aws.amazon.com/about-aws/whats-new/2020/05/amazon-dynamodb-now-supports-empty-values-for-non-key-string-and-binary-attributes-in-dynamodb-tables/

Per issue #149, this PR removes the check in faraday, so that it no longer fails with Invalid DynamoDB value: "" (empty string).

kipz commented 3 years ago

Thanks so much for the PR @smithtim! :)

Looks good to me on first glance, though I'm wondering if we should change the test and implementation here to reflect what we now consider empty to keep things consistent?

joelittlejohn commented 3 years ago

I was thinking the same thing @kipz. This is going to change the external behaviour of this public function, which I don't relish doing, however since the primary purpose of this function is to sanitise a value to allow it to be written to DynamoDB I think this function should remain in line with the DynamoDB rules.

smithtim commented 3 years ago

Okay, I have made this change.