mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-23 16:00:38 +00:00
python ducklake client arg fix
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user