From 07d7c4905d65b7f28c1ffcbd33f81ee52c9fd847 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 24 Oct 2012 15:37:06 -0400 Subject: Fixed bug where keyword arguments passed to :meth:`.Compiler.process` wouldn't get propagated to the column expressions present in the columns clause of a SELECT statement. In particular this would come up when used by custom compilation schemes that relied upon special flags. [ticket:2593] --- lib/sqlalchemy/engine/interfaces.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/sqlalchemy/engine/interfaces.py') diff --git a/lib/sqlalchemy/engine/interfaces.py b/lib/sqlalchemy/engine/interfaces.py index e9e0da436..c60120166 100644 --- a/lib/sqlalchemy/engine/interfaces.py +++ b/lib/sqlalchemy/engine/interfaces.py @@ -673,7 +673,8 @@ class Compiled(object): defaults. """ - def __init__(self, dialect, statement, bind=None): + def __init__(self, dialect, statement, bind=None, + compile_kwargs=util.immutabledict()): """Construct a new ``Compiled`` object. :param dialect: ``Dialect`` to compile against. @@ -682,6 +683,9 @@ class Compiled(object): :param bind: Optional Engine or Connection to compile this statement against. + + :param compile_kwargs: additional kwargs that will be + passed to the initial call to :meth:`.Compiled.process`. """ self.dialect = dialect @@ -689,7 +693,7 @@ class Compiled(object): if statement is not None: self.statement = statement self.can_execute = statement.supports_execution - self.string = self.process(self.statement) + self.string = self.process(self.statement, **compile_kwargs) @util.deprecated("0.7", ":class:`.Compiled` objects now compile " "within the constructor.") -- cgit v1.2.1