]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Fix the "greatest" example.
authorKonstantin Tretyakov <kt@ut.ee>
Mon, 10 Dec 2018 02:20:02 +0000 (03:20 +0100)
committerGitHub <noreply@github.com>
Mon, 10 Dec 2018 02:20:02 +0000 (03:20 +0100)
commit03ea0b3a0837a60afb21ac85fd4bbf13be0ac0bd
treed73bb3a9024fa660872be7ca6ea97fbfe1efce2d
parent0d4c0c1a279525e09659e21488348718743c33f9
Fix the "greatest" example.

The current code does not pass `**kw` down to further compiler.process calls, thus the example does not work when invoked with, `literal_binds=True`.

Besides, the calls to `process` each argument twice are wasteful, and reusing the built-in `case` expression instead of hard-coding the SQL statements seems slightly nicer, doesn't it?
lib/sqlalchemy/ext/compiler.py