Revert "fix(qb-pg): Type cast boolean params as int"

This reverts commit 06183535af.
This commit is contained in:
Gavin D'souza 2022-04-19 18:55:04 +05:30
parent 8db6bf48f6
commit 1a8ff7275d

View file

@ -89,17 +89,7 @@ def patch_query_execute():
pass
else:
raise frappe.PermissionError("Only SELECT SQL allowed in scripting")
params = param_collector.get_parameters()
# wrap boolean values as integer since we save Check as smallint and pg doesn't
# like boolean values in place of ints and frappe doesn't support Boolean types
# explicitly.
if frappe.conf.db_type == "postgres":
for k, v in params.items():
if isinstance(v, bool):
params[k] = int(v)
return query, params
return query, param_collector.get_parameters()
query_class = get_attr(str(frappe.qb).split("'")[1])
builder_class = get_type_hints(query_class._builder).get("return")