Fixes #7215 -- no bind for param (#7226)

* Fix no bind for params

* Update ingestion/src/metadata/orm_profiler/orm/functions/median.py

Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com>

Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com>
This commit is contained in:
Teddy 2022-09-05 15:53:31 +02:00 committed by GitHub
parent 6cfd39c025
commit 22eca3a6f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,8 +30,8 @@ class MedianFn(FunctionElement):
@compiles(MedianFn)
def _(elements, compiler, **kwargs):
col, _ = [compiler.process(element, **kwargs) for element in elements.clauses]
return "percentile_cont(0.5) WITHIN GROUP (ORDER BY %s ASC)" % col
col = elements.clauses.clauses[0].name
return "percentile_cont(0.5) WITHIN GROUP (ORDER BY %s ASC)" % col
@compiles(MedianFn, Dialects.BigQuery)