Fix MSSQL modulo (#5707)

This commit is contained in:
Pere Miquel Brull 2022-06-28 15:53:16 +02:00 committed by GitHub
parent 8b7f9f1f8c
commit aab7544778
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,6 +47,12 @@ def _(element, compiler, **kw):
return f"{value} % {base}" return f"{value} % {base}"
@compiles(ModuloFn, Dialects.MSSQL)
def _(element, compiler, **kw):
value, base = validate_and_compile(element, compiler, **kw)
return f"{value} %% {base}"
@compiles(ModuloFn, Dialects.BigQuery) @compiles(ModuloFn, Dialects.BigQuery)
@compiles(ModuloFn, Dialects.Redshift) @compiles(ModuloFn, Dialects.Redshift)
@compiles(ModuloFn, Dialects.Snowflake) @compiles(ModuloFn, Dialects.Snowflake)