python ducklake client arg fix

This commit is contained in:
Diego Imbert
2025-11-28 16:32:02 +01:00
parent f7fe83d965
commit b65b7cd048
+4 -4
View File
@@ -1699,12 +1699,12 @@ class DucklakeClient:
def __init__(self, client: Windmill, name: str):
self.client = client
self.name = name
def fetch(self, sql: str, *args):
def fetch(self, sql: str, **kwargs):
args_dict = {}
args_def = ""
for i, arg in enumerate(args):
args_dict[f"arg{i+1}"] = arg
args_def += f"-- $arg{i+1}\n"
for key, value in kwargs.items():
args_dict[key] = value
args_def += f"-- ${key}\n"
attach = f"ATTACH 'ducklake://{self.name}' AS dl;USE dl;\n"
sql = args_def + attach + sql
return self.client.run_inline_script_preview(