@@ -230,6 +230,9 @@ def __init__(
230230 self ._use_arrow_native_complex_types = kwargs .get (
231231 "_use_arrow_native_complex_types" , True
232232 )
233+ # This is a connection option: the kernel fixes the SEA result
234+ # disposition policy for the lifetime of its session.
235+ self ._use_cloud_fetch = bool (kwargs .get ("use_cloud_fetch" , True ))
233236 # NB: don't call ``kernel_auth_kwargs`` here. That call
234237 # materialises the bearer token in-process; keeping a
235238 # cleartext copy on a long-lived connector object that may
@@ -293,12 +296,18 @@ def open_session(
293296 ) -> SessionId :
294297 if self ._kernel_session is not None :
295298 raise InterfaceError ("KernelDatabricksClient already has an open session." )
296- # ``session_configuration`` flows through to the kernel's
297- # ``session_conf`` map verbatim; the SEA endpoint enforces
298- # its own allow-list and rejects unknown keys.
299- session_conf : Optional [Dict [str , str ]] = None
300- if session_configuration :
301- session_conf = {k : str (v ) for k , v in session_configuration .items ()}
299+ # Convert server session confs to strings, then add the kernel's
300+ # client-side CloudFetch knob to the same boundary map.
301+ session_conf = (
302+ {k : str (v ) for k , v in session_configuration .items ()}
303+ if session_configuration
304+ else {}
305+ )
306+ # The kernel consumes this before filtering the server confs and
307+ # selects INLINE when CloudFetch is disabled.
308+ session_conf ["cloudfetch_enabled" ] = (
309+ "true" if self ._use_cloud_fetch else "false"
310+ )
302311 # The kwarg builds run INSIDE the try so the ``finally`` scrub
303312 # below always fires — including when ``kernel_auth_kwargs``
304313 # itself raises mid-build (e.g. an OAuth token-exchange failure
0 commit comments