From c2feaa98ed374151d40a85fa52344de8ec87dad6 Mon Sep 17 00:00:00 2001 From: saarni Date: Thu, 26 May 2016 10:52:24 +0300 Subject: Changed how TableSample handles method and arg. Instead of passing a float percentage and a string method, accept either a non Function value wrapped in func.system, or a Function, which is rendered as is. --- lib/sqlalchemy/sql/compiler.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/sqlalchemy/sql/compiler.py') diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index ab1b42b2f..dbf919cf3 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -1325,10 +1325,9 @@ class SQLCompiler(Compiled): return "LATERAL %s" % self.visit_alias(lateral, **kw) def visit_tablesample(self, tablesample, asfrom=False, **kw): - text = "%s TABLESAMPLE %s(%s)" % ( + text = "%s TABLESAMPLE %s" % ( self.visit_alias(tablesample, asfrom=True, **kw), - tablesample.method, - tablesample.arg) + tablesample._get_method()._compiler_dispatch(self, **kw)) if tablesample.seed is not None: text += " REPEATABLE (%s)" % ( -- cgit v1.2.1