run_inline_script_preview in python client

This commit is contained in:
Diego Imbert
2025-11-27 17:38:14 +01:00
parent 5d64ad33c1
commit ced21178e8
+28
View File
@@ -276,6 +276,21 @@ class Windmill:
cleanup=cleanup, assert_result_is_not_none=assert_result_is_not_none
)
def run_inline_script_preview(
self,
content: str,
language: str,
args: dict = None,
) -> Any:
"""Run a script on the current worker without creating a job"""
endpoint = f"/w/{self.workspace}/jobs/run_inline/preview"
body = {
"content": content,
"language": language,
"args": args or {},
}
return self.post(endpoint, json=body).text
def wait_job(
self,
job_id,
@@ -1527,6 +1542,19 @@ def run_script_by_hash(
timeout=timeout,
)
@init_global_client
def run_inline_script_preview(
content: str,
language: str,
args: dict = None,
) -> Any:
"""Run a script on the current worker without creating a job"""
return _client.run_inline_script_preview(
content=content,
language=language,
args=args,
)
@init_global_client
def username_to_email(username: str) -> str: