taoensso / faraday

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

JC: Fix cc-units for batch responses #49

Closed johnchapin closed 9 years ago

johnchapin commented 9 years ago

This fixes an error I was seeing in trying to return the consumed capacity from batch operations:

=> (faraday/batch-get-item options {:my_table {:prim-kvs {:my_key ["foo" "bar"]}}} {:return-cc? true}))

CompilerException java.lang.ClassCastException: com.amazonaws.internal.ListWithAutoConstructFlag cannot be cast to com.amazonaws.services.dynamodbv2.model.ConsumedCapacity, compiling:(form-init4303440963934561960.clj:1:12)

The patch adds a batch-cc-units method which is called from the as-map implementations for BatchGetItemResult and BatchWriteItemResult.

ptaoussanis commented 9 years ago

Thanks John, looks good!