Query.get() is a legacy SQLAlchemy 1.x construct that emits
LegacyAPIWarning on every invocation. Session.get() is the 2.0
replacement.
Also guard against None primary keys in
tools/parameters/basic.py where the value can legitimately be
absent (previously triggered 'SAWarning: fully NULL primary key
identity cannot load any object').