For a simple example of SQLAlchemy’s coalesce function, this may help: Handling null values in a SQLAlchemy query – equivalent of isnull, nullif or coalesce.
Here are a couple of key lines of code from that post:
from sqlalchemy.sql.functions import coalesce
my_config = session.query(Config).order_by(coalesce(Config.last_processed_at, datetime.date.min)).first()