We've had trouble with `meltano elt` runs failing ...
# plugins-general
a
We've had trouble with
meltano 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-e73ec1af3a3ffa6444c10840dea2dbefa7aed8ba8f256548f334a510a4f2e856R230
a
This is great! Thanks for sharing. I don't recall if the SDK does something like this already but regardless, it is very nice to have this as a standalone importable library. 🚀
a
I learned the newer versions of the SDK does transform numeric fields into
decimal.Decimal
instances. Which is nice. But it doesn't handle
decimal.DivisionImpossible
exceptions. This does