adam_roderick
02/10/2022, 8:23 PMmeltano elt
runs failing when precision doesn't match among the tap, target, and Python. For example, we had tap-mongodb producing a precision of 1e-34, while the default precision of Python's decimal
library is 28. Targets that verify the schema fail when this happens.
We looked at how one of the target-postgres solved this, and encapsulated it into a standalone repository https://github.com/Datateer/adjust-precision-for-schema. I hope this is useful for target developers
Using it is simple. This function walks the schema, inspecting it for numeric precision, and adjust's the Python context's precision if needed. An example is at https://github.com/ome9ax/target-s3-jsonl/pull/20/files#diff-e73ec1af3a3ffa6444c10840dea2dbefa7aed8ba8f256548f334a510a4f2e856R230aaronsteers
02/10/2022, 8:49 PMadam_roderick
02/11/2022, 12:21 AMdecimal.Decimal
instances. Which is nice. But it doesn't handle decimal.DivisionImpossible
exceptions. This does