diff options
author | saarni <saarni@gmail.com> | 2016-05-26 10:52:24 +0300 |
---|---|---|
committer | saarni <saarni@gmail.com> | 2016-05-26 10:52:24 +0300 |
commit | c2feaa98ed374151d40a85fa52344de8ec87dad6 (patch) | |
tree | 186d961e2c0fe5f2ceed04fb2ad7552e010d8f05 /lib/sqlalchemy/sql/compiler.py | |
parent | d9f3571ebf51523bff16c8d228817dbfbf285728 (diff) | |
download | sqlalchemy-pr/277.tar.gz |
Changed how TableSample handles method and arg.pr/277
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.
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 5 |
1 files changed, 2 insertions, 3 deletions
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)" % ( |