Summary
The Python SDK currently lacks client-level proxy configuration, requiring users to set global environment variables (HTTP_PROXY/HTTPS_PROXY) which affects all HTTP traffic in the application. This is problematic when only Databricks API calls need to be routed through a proxy.
Use Case
In enterprise environments, Databricks workspaces are often accessible only through specific proxy servers, while other services in the same application should not use the proxy. Setting environment variables globally is not a viable solution because:
- It affects all HTTP clients in the application
- It's not thread-safe when multiple clients need different proxy configurations
- It doesn't allow for proxy authentication without exposing credentials in environment variables
Proposed Solution
Add proxy configuration parameters to the Config class, similar to the Java SDK implementation:
from databricks.sdk import WorkspaceClient
from databricks.sdk.core import Config
config = Config(
host="https://adb-xxx.databricks.com",
client_id="...",
client_secret="...",
proxy_url="http://proxy-host:port",
proxy_auth_type="BASIC", # or "SPNEGO"
proxy_username="user",
proxy_password="pass"
)
client = WorkspaceClient(config=config)
Summary
The Python SDK currently lacks client-level proxy configuration, requiring users to set global environment variables (
HTTP_PROXY/HTTPS_PROXY) which affects all HTTP traffic in the application. This is problematic when only Databricks API calls need to be routed through a proxy.Use Case
In enterprise environments, Databricks workspaces are often accessible only through specific proxy servers, while other services in the same application should not use the proxy. Setting environment variables globally is not a viable solution because:
Proposed Solution
Add proxy configuration parameters to the
Configclass, similar to the Java SDK implementation: