Closed metaskills closed 5 years ago
The problem with aggregate types in this case is that at the DynamoDB level, there’s just one numeric type and the low-level SDK clients use BigDecimal to avoid losing precision.
In individual numeric types, I can use the attribute type to perform type casting. For aggregate types, I don’t want to guess.
So, adding logic to your code to iterate and type cast is fine. If you know you’re making homogenous lists, you could also define a custom type like integer_list_type and write it’s type caster appropriately.
Thanks for the reply! Gonna close this out too.
I've noticed that when I use a nested list, that integers come back as BigDecimal even tho they are PUT into an item using
N
type. This means I have to take on the need of type casting my items collection as needed. This seems fine an natural to me but wanted to make sure this was not an issue or if there was some better direction/method to use?For example, as is now. My collect is using an
_list
as the name and then in my model I have alist
method that iterates over_list
data and casts it accordingly. Sound good?