Skip to content

Commit

Permalink
sort columns when rendering an UpdateExpression for test stability
Browse files Browse the repository at this point in the history
  • Loading branch information
numberoverzero committed Aug 3, 2016
1 parent e088dc6 commit 3fb4ef0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bloop/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ def update_expression(self, obj):
"remove": []}
# Don't include key columns in an UpdateExpression
key = {obj.Meta.hash_key, obj.Meta.range_key}
for column in filter(lambda c: c not in key, get_marked(obj)):
for column in sorted(
filter(lambda c: c not in key, get_marked(obj)),
key=lambda c: c.dynamo_name):
nref = self.name_ref(column)
value = getattr(obj, column.model_name, None)
value = self.engine._dump(column.typedef, value)
Expand Down

0 comments on commit 3fb4ef0

Please sign in to comment.