99import json
1010import os
1111import decimal
12+ from urllib .parse import urlparse
1213from uuid import UUID
1314
1415from databricks .sql import __version__
@@ -322,6 +323,16 @@ def read(self) -> Optional[OAuthToken]:
322323 session_id_hex = self .get_session_id_hex ()
323324 )
324325
326+ # Determine proxy usage
327+ use_proxy = self .http_client .using_proxy ()
328+ proxy_host_info = None
329+ if use_proxy and self .http_client .proxy_uri :
330+ parsed = urlparse (self .http_client .proxy_uri )
331+ proxy_host_info = HostDetails (
332+ host_url = parsed .hostname or self .http_client .proxy_uri ,
333+ port = parsed .port or 8080
334+ )
335+
325336 driver_connection_params = DriverConnectionParameters (
326337 http_path = http_path ,
327338 mode = DatabricksClientType .SEA
@@ -331,13 +342,31 @@ def read(self) -> Optional[OAuthToken]:
331342 auth_mech = TelemetryHelper .get_auth_mechanism (self .session .auth_provider ),
332343 auth_flow = TelemetryHelper .get_auth_flow (self .session .auth_provider ),
333344 socket_timeout = kwargs .get ("_socket_timeout" , None ),
345+ azure_workspace_resource_id = kwargs .get ("azure_workspace_resource_id" , None ),
346+ azure_tenant_id = kwargs .get ("azure_tenant_id" , None ),
347+ use_proxy = use_proxy ,
348+ use_system_proxy = use_proxy ,
349+ proxy_host_info = proxy_host_info ,
350+ use_cf_proxy = False , # CloudFlare proxy not yet supported in Python
351+ cf_proxy_host_info = None , # CloudFlare proxy not yet supported in Python
352+ non_proxy_hosts = None ,
353+ allow_self_signed_support = kwargs .get ("_tls_no_verify" , False ),
354+ use_system_trust_store = True , # Python uses system SSL by default
355+ enable_arrow = pyarrow is not None ,
356+ enable_direct_results = True , # Always enabled in Python
357+ enable_sea_hybrid_results = kwargs .get ("use_hybrid_disposition" , False ),
358+ http_connection_pool_size = kwargs .get ("pool_maxsize" , None ),
359+ rows_fetched_per_block = DEFAULT_ARRAY_SIZE ,
360+ async_poll_interval_millis = 2000 , # Default polling interval
361+ support_many_parameters = True , # Native parameters supported
362+ enable_complex_datatype_support = _use_arrow_native_complex_types ,
363+ allowed_volume_ingestion_paths = self .staging_allowed_local_path ,
334364 )
335365
336366 self ._telemetry_client .export_initial_telemetry_log (
337367 driver_connection_params = driver_connection_params ,
338368 user_agent = self .session .useragent_header ,
339369 )
340- self .staging_allowed_local_path = kwargs .get ("staging_allowed_local_path" , None )
341370
342371 def _set_use_inline_params_with_warning (self , value : Union [bool , str ]):
343372 """Valid values are True, False, and "silent"
0 commit comments