Incoming records contain an amount as a string.
Convert valid values to Decimal and send conversion failures to an error output without corrupting valid calculations.
Which implementation is most appropriate?
Validate and convert inside try/except, then route failed records with their identifiers and error details to an isolated output.
Detailed explanation
Conversion errors can be captured while valid records continue through the normal path.
Conversion errors can be captured while valid records continue through the normal path.
A log alone does not separate invalid data from the trusted output.
A log alone does not separate invalid data from the trusted output.
Invalid strings fail and floating-point representation can introduce monetary rounding issues.
Invalid strings fail and floating-point representation can introduce monetary rounding issues.
A storage class controls storage characteristics, not the type of a value.
A storage class controls storage characteristics, not the type of a value.
Check official documentation
Compare the following points with the official documentation.
Python decimal、try/except、例外処理とGlueエラー行処理を確認する。
What to confirm
型変換とログ記録、保存設定の違いを説明できる。
Key points
- Python exception
- Type validation
- Decimal
- Error records
Notes
- Environment: AWS公式DEA-C01試験ガイドと各サービスの公式ドキュメントの確認
- Confirm current AWS service behavior in the official DEA-C01 documentation.
Foundation review
Type contract
Validate nulls, formats, ranges, and precision before converting input values.
Failure observability
Keep the original record and error cause instead of silently dropping invalid data.