@@ -452,20 +452,19 @@ def fake_session(**kw):
452452 assert captured ["telemetry_circuit_breaker_enabled" ] is False
453453
454454
455- def test_open_session_omits_phase_7_kwargs_kernel_does_not_accept (monkeypatch ):
456- """Phase-7 identity/telemetry kwargs must NOT be forwarded to a kernel
457- ``Session`` whose (fixed, no-``**kwargs``) constructor doesn't declare
458- them.
455+ def test_open_session_omits_optional_kwargs_kernel_does_not_accept (monkeypatch ):
456+ """Optional kwargs must NOT be forwarded to a kernel ``Session`` whose
457+ fixed constructor doesn't declare them.
459458
460459 The real ``databricks_sql_kernel.Session`` is a PyO3 class with a fixed
461460 signature. The other tests here use a ``**kwargs`` MagicMock that silently
462461 swallows unsupported kwargs; this fixed-signature fake proves the client
463- filters optional telemetry kwargs.
462+ filters optional kwargs.
464463 """
465464 captured = {}
466465
467- # Accept baseline connection/tls/retry/pool kwargs but no phase-7 identity
468- # or telemetry kwargs, and no **kwargs catch-all.
466+ # Accept baseline connection/tls/retry kwargs but no max-connections,
467+ # phase-7 identity, or telemetry kwargs, and no **kwargs catch-all.
469468 def fake_session_v0_2_0 (
470469 host ,
471470 http_path ,
@@ -494,7 +493,6 @@ def fake_session_v0_2_0(
494493 complex_types_as_json = False ,
495494 intervals_as_string = False ,
496495 request_timeout_secs = None ,
497- max_connections = None ,
498496 ):
499497 captured ["host" ] = host
500498 sess = MagicMock ()
@@ -532,10 +530,11 @@ def fake_session_v0_2_0(
532530 http_path = "/sql/1.0/warehouses/abc" ,
533531 auth_provider = AccessTokenAuthProvider ("dapi-test" ),
534532 ssl_options = None ,
533+ max_connections = 41 ,
535534 telemetry_options = {"enable_telemetry" : True , "telemetry_batch_size" : 17 },
536535 )
537- # Would raise TypeError: unexpected keyword argument if the client
538- # forwarded phase-7 kwargs the fixed-signature Session doesn't declare.
536+ # Would raise TypeError if the client forwarded max-connections or
537+ # phase-7 kwargs the fixed-signature Session doesn't declare.
539538 c .open_session (session_configuration = None , catalog = None , schema = None )
540539 assert captured ["host" ] == "example.cloud.databricks.com"
541540
0 commit comments