rust: Add sedona-error crate to make error handling between crates less verbose
- Dominant language
- Rust
- Stars
- 503
- Forks
- 61
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 90
Description
In general, we use `DataFusionError` everywhere in the sedona crates, except for the few crates that don't involve DataFusion (e.g., sedona-geometry, sedona-raster). Sedona raster rather awkwardly uses ArrowError, because that is the error type it more directly uses most of the time. It's fairly common for sedona-geometry's error to be used in kernels, where there is a lot of `.map_err()`s instead of `?`s.
We can consolidate errors to a crate `sedona-error` that has features `arrow` and `datafusion`, which, when enabled, add error variants and `From<>` implementations for ArrowError and DataFusionError. This will hopefully make the error handling between crates a bit more unified and reduce the number of dedicated error classes we need.
Contributor guide
Research direction
Start by inspecting the existing error types and usages in sedona-geometry and sedona-raster, especially the kernel call sites with repeated map_err() calls. Define the scope of the proposed sedona-error crate and its arrow and datafusion features; done means the relevant crates share the consolidated error handling with appropriate conversions and fewer dedicated error classes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend, databases
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100