Fix python datatable client requiring explicit types (#8086)

* Support arg type decl in postgres

* Python datatable client no longer requires explicit arg typing

* compilation fix

* Set correct type in statement exec

* reset to main

* Explicit pg arg types

* remove code duplication

* update parser js

* FLOAT8 doesn't have space

---------

Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
This commit is contained in:
Diego Imbert
2026-02-28 08:08:02 +01:00
committed by GitHub
parent 83aee49978
commit 762fd3d993
7 changed files with 367 additions and 132 deletions
+2 -2
View File
@@ -2228,7 +2228,7 @@ class DataTableClient:
args_def = ""
for i, arg in enumerate(args):
args_dict[f"arg{i+1}"] = arg
args_def += f"-- ${i+1} arg{i+1}\n"
args_def += f"-- ${i+1} arg{i+1} ({infer_sql_type(arg)})\n"
sql = args_def + sql
return SqlQuery(
sql,
@@ -2338,7 +2338,7 @@ def infer_sql_type(value) -> str:
elif isinstance(value, int):
return "BIGINT"
elif isinstance(value, float):
return "DOUBLE PRECISION"
return "FLOAT8"
elif value is None:
return "TEXT"
elif isinstance(value, str):