-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DynamoDB: empty update expression now returns a ValidationException #7989
DynamoDB: empty update expression now returns a ValidationException #7989
Conversation
I see some tests are failing, I'll have another look:) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @felixscherz, thanks for opening a PR for this!
The update_expression
can be None when calling update_item
in models
, which would be absolutely valid. I would suggest to add this validation in responses.py
instead, where the request first comes in:
moto/moto/dynamodb/responses.py
Line 892 in 856ded1
update_expression = self.body.get("UpdateExpression", "").strip() |
If the user-provided value is an empty string here, we should throw an exception - everything else can stay the same.
Ok great, thanks for the help! I will have a look at the |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7989 +/- ##
=======================================
Coverage 94.37% 94.37%
=======================================
Files 1125 1125
Lines 96369 96374 +5
=======================================
+ Hits 90948 90953 +5
Misses 5421 5421
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great - thank you for adding this to Moto @felixscherz!
This is now part of moto >= 5.0.13.dev55 |
Hi, this is intended to fix an issue with dynamodb where an emtpy update expression given to
update_item
raises an unexpected exception: #7988