mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-18 16:02:10 +00:00
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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user