Support null values in parsers when services accepts and returns null values. #3574
+18
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses parsing where the
_handle_integermethod returns with a TypeError when a service (e.g. RDS Data API) supports and returnsnullorNonevalues.The root cause lies in the
_handle_integermethod inRestJSONParserclass, which directly calls int(value) without validating whether the value is None or not This creates an inconsistency where successful cases like integers parse correctly, but any value containing null values triggers aTypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'.The fix implements proper null value validation in the integer parsing logic, ensuring that null values are handled gracefully while maintaining backward compatibility with existing functionality. This change allows AWS services to properly support null values.
Fixes: boto/boto3#4508