4 ms·
I implemented a data processing API for customers to write convert and validate their unstructured tabular data in a defined way. For each column a user could
by paddy_m 3y ago
I implemented a data processing API for customers to write convert and validate their unstructured tabular data in a defined way. For each column a user could specify/override one of 5 functions.
cast: (str|null) -> T
compute: T -> T
validate: (T) -> Message[] // doesn't modify the value
serialize: (T) -> str // primarily used so dates can be formatted
Each function was guarded by a try/catch block. This allowed users to write simple functions and not have an edge case blow up all of processing.
It ended up working pretty well. I don't think it was quite railway oriented programming, more a carefully thought out framework.