]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Use UnsupportedCompilationError for no default compiler
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 14 Jan 2021 16:18:58 +0000 (11:18 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 14 Jan 2021 16:29:50 +0000 (11:29 -0500)
commitb4c6cfc2fde6c652e79ca157f8023a3f8941bc3c
tree8d494f71cb634060584555e6bc0aadbc8e3dfa3a
parent0a41f9bea6602c52c59af0f7b572308b2c2b27ab
Use UnsupportedCompilationError for no default compiler

Fixed issue where the stringification that is sometimes called when
attempting to generate the "key" for the ``.c`` collection on a selectable
would fail if the column were an unlabeled custom SQL construct using the
``sqlalchemy.ext.compiler`` extension, and did not provide a default
compilation form; while this seems like an unusual case, it can get invoked
for some ORM scenarios such as when the expression is used in an "order by"
in combination with joined eager loading.  The issue is that the lack of a
default compiler function was raising :class:`.CompileError` and not
:class:`.UnsupportedCompilationError`.

Fixes: #5836
Change-Id: I5af243b2c70c7dcca4b212a3869c3017a50c132b
doc/build/changelog/unreleased_13/5836.rst [new file with mode: 0644]
lib/sqlalchemy/exc.py
lib/sqlalchemy/ext/compiler.py
test/ext/test_compiler.py