Improve typing
Background
With SQLAlchemy upgraded to v2.0, we can get more out of Python typings. However, we need to type up function arguments, primarily session
should always be typed to take advantage of #2236 (closed)
Implementation
Add Session type throughout the code and other typings until Mypy is satisfied.