Context
We currently use the Union export from the typing module to define type annotations where more than one type is acceptable. This works, but for more complicated type annotations, using Union makes the code more difficult to read and understand relative to |.
As of python 3.10, the | operator works as Union would but with a simpler syntax. This can improve code readability significantly in some scenarios.
Description
Because the minimum version of python that polaris-lib supports is 3.10, we should embrace the use of the pipe operator rather than the Union type hint.
Acceptance Criteria
- Redefine all types where
Union is used to leverage the | operator instead
- Ensure all types do not change after the replacement and resolve to the same type annotation