Improve ORM loader strategy error messages to use user-friendly representations
Improved error messages raised when ORM loader strategy options cannot be
applied to a query. Messages now render the offending option in a
user-friendly form such as ``joinedload(User.orders)`` rather than exposing
internal class and path representations, and the "does not apply to root
entities" message now includes the option that triggered the error. The
same user-friendly rendering is also applied to the "conflicting loader
strategy" message and to the ``of_type()`` representation in "does not
link" messages. Originating pull request courtesy Jan Vollmer.
Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Fixes: #12398
Closes: #12401
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12401
Pull-request-sha:
4de2e161924d2d61ee7ad8402315da754e7995f4
Change-Id: I41c4f7fd077bd7fdb6e6ac9675370a37f7e7d7b4