-
Notifications
You must be signed in to change notification settings - Fork 421
parse function raises InvalidModelTypeError instead of ValidationError #5252
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
Comments
Thanks for opening your first issue here! We'll come back to you as soon as we can. |
Hey @jhare-rectangle! Thanks for reporting this bug! Actually I think you're right. We should not catch
No, there is no diference, you'll experiment the same problem when using Layer. Give me until tomorrow to talk to the other maintainers, but I think we'll need to revert this change and continue raising Again, thank you very much for reporting this to allow us to fix this in the early days of v3. |
Hey @jhare-rectangle! We expect to merge the PR #5259 today and revert this regression. |
|
This is now released under 3.1.0 version! |
Expected Behaviour
When any validation in a Pydantic model fails during a call to Powertools
parse()
function, I expectparse()
to raiseValidationError
. This is what happened prior to updating to version 3 of Powertools and is reflected in this example from Powertools documentation: https://docs.powertools.aws.dev/lambda/python/latest/utilities/parser/#parse-functionCurrent Behaviour
When the passed in object fails model validation in
parse()
, it is raisingInvalidModelTypeError
.Code snippet
Possible Solution
No response
Steps to Reproduce
I am just running this locally at the moment. I don't know if the Lambda Layer might somehow behavior differently since.
Powertools for AWS Lambda (Python) version
3.0.2.dev1
AWS Lambda function runtime
3.12
Packaging format used
PyPi
Debugging logs
The text was updated successfully, but these errors were encountered: