Skip to content

Commit 04ae5cc

Browse files
authored
Support ssh tunnel connections on DBR 14 (#3807)
## Changes Old DBRs have old py sdk which doesn't have native auth provider, so we have to be explicit when initializing the workspace client. ## Why One customer is tied to dbr 14 and asked if we can support it. ## Tests Manual and existing tests
1 parent 43bea62 commit 04ae5cc

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

experimental/ssh/internal/client/ssh-server-bootstrap.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,16 @@ def setup_exit_handler():
7171

7272

7373
def run_ssh_server():
74-
# Start the SSH tunnel
7574
ctx = get_context()
76-
client = WorkspaceClient()
75+
76+
# Old DBRs require explicit WorkspaceClient arguments
77+
try:
78+
client = WorkspaceClient()
79+
except Exception as e:
80+
client = WorkspaceClient(
81+
host=ctx.workspaceUrl or spark.conf.get("spark.databricks.workspaceUrl"), token=ctx.apiToken
82+
)
83+
7784
workspace_url = ctx.workspaceUrl or client.config.host or spark.conf.get("spark.databricks.workspaceUrl")
7885
user_name = client.current_user.me().user_name
7986

0 commit comments

Comments
 (0)