Closed gijsber closed 1 year ago
So implement on both levels:
This looks interesting for validating Arrow tables: https://github.com/beacon-biosignals/Legolas.jl/. It is used in https://github.com/beacon-biosignals/LegolasFlux.jl/.
for this moment we can have data struct duplications (julia, plugin, python) if we introduce rules, you want to have it better organized at this moment keep validation in julia ~3d (complexity we may need to touch the structs that affect computation)
For future revisit if we want to move to Rust-CLI (#90) doing validation before handing over to julia. This could be used by python and plugin as well.
Ok, so ideally, we generate a schema (jsonschema) from a single source, and use that in all other code. For me, that looks like:
Julia -> Jsonschema -> Python / QGIS
The main reason is because Julia has to be able to compute with the input, so it has to be compatible there.
One can generate Pydantic BaseModels in Python from jsonschemas. These can be used in Pandera as well, although it might be slower. There's an open issue for Pandera to directly generate Pandera models from jsonschema, feel free to upvote it.
Enable validation of input: