Maybe null (None in Python) values in your Value field? Try changing the if statement to: if newValue is not None and newValue > 0: return...etcAnother possibility: is Value a text field?These don't seem like syntax errors to me, but worth a shot. Maybe also check if Value is the real field name, and not an alias. Again not an expected error, but hey...