account for keys potentially being substrings of other keys (e.g. #c1 and #c10)

This commit is contained in:
Peter Gorniak 2016-12-06 12:14:57 -08:00
parent 2c50561563
commit 98a39cf4b5

View File

@ -118,7 +118,7 @@ class Item(object):
# A Real value
value = value.lstrip(":").rstrip(",")
for k, v in expression_attribute_names.items():
value = value.replace(k, v)
value = re.sub(r'{}\b'.format(k), v, value)
if action == "REMOVE":
self.attrs.pop(value, None)
elif action == 'SET':