From ced21178e89797c8314310d1bb2099de10374b72 Mon Sep 17 00:00:00 2001 From: Diego Imbert Date: Thu, 27 Nov 2025 17:38:14 +0100 Subject: [PATCH] run_inline_script_preview in python client --- python-client/wmill/wmill/client.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/python-client/wmill/wmill/client.py b/python-client/wmill/wmill/client.py index 0f8deb9ea1..c142c75eed 100644 --- a/python-client/wmill/wmill/client.py +++ b/python-client/wmill/wmill/client.py @@ -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: