Skip to content

Commit

Permalink
dynamically create client if it is not provided for remote
Browse files Browse the repository at this point in the history
  • Loading branch information
Sri Tikkireddy committed Sep 17, 2024
1 parent bc42a91 commit 1bf4870
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion uc_functions/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,13 @@ def remote(*args, _wait_timeout="10s", **kwargs):
provided_ws_client: Optional[WorkspaceClient] = kwargs.pop(
"workspace_client", None
)
provided_warehouse_id: Optional[str] = kwargs.pop("warehouse_id", None)
if provided_ws_client is None:
# this cant be above because WorkspaceClient construction validates auth and will fail tests
provided_ws_client = WorkspaceClient()
provided_warehouse_id: Optional[str] = kwargs.pop(
"warehouse_id",
self._get_first_warehouse_id(ws_client=provided_ws_client),
)
if kwargs:
raise ValueError("Keyword arguments are not supported in remote calls")
assert (
Expand Down

0 comments on commit 1bf4870

Please sign in to comment.