@@ -154,19 +154,10 @@ def _kernel_session_accepts_kwarg(name: str) -> bool:
154154
155155 The kernel ``Session`` is a PyO3 class with a **fixed** signature (no
156156 ``**kwargs`` catch-all), so forwarding a kwarg it doesn't declare raises
157- ``TypeError`` at construction. The phase-7 identity/telemetry kwargs
158- (``driver_name`` etc.) only exist on wheels newer than the pinned
159- ``^0.2.0`` (whose ``Session`` accepts none of them), so we must gate them
160- on what the actually-installed wheel supports rather than pass them
161- unconditionally. Falls **closed** (returns ``False``) when the signature
162- can't be introspected: a PyO3 class only exposes ``__text_signature__``
163- (and thus an introspectable signature) when built with
164- ``#[pyo3(signature=...)]``; otherwise ``inspect.signature`` raises
165- ``ValueError``. Since the pinned ``^0.2.0`` ``Session`` accepts none of
166- these kwargs, forwarding one it doesn't declare is a hard ``TypeError`` at
167- construction that breaks every ``use_kernel=True`` connection, whereas
168- omitting one the wheel *would* have accepted only loses telemetry
169- richness — so we omit the kwarg on introspection failure.
157+ ``TypeError`` at construction, so we gate kwargs on what the installed
158+ wheel supports. Falls **closed** (returns ``False``) when the signature
159+ can't be introspected because omitting an accepted telemetry kwarg is safer
160+ than forwarding an unsupported one.
170161 """
171162 try :
172163 params = inspect .signature (_kernel .Session ).parameters
@@ -181,9 +172,7 @@ def _kernel_telemetry_kwargs(options: Dict[str, Any]) -> Dict[str, Any]:
181172 """Build phase-7 telemetry/system kwargs for ``databricks_sql_kernel.Session``.
182173
183174 Only kwargs the installed ``Session`` constructor actually accepts are
184- returned; on the pinned ``^0.2.0`` wheel (which predates phase 7) this is
185- empty, so ``open_session`` doesn't break with ``TypeError`` on a wheel
186- that doesn't yet know these kwargs.
175+ returned, preventing ``TypeError`` when the binding lacks an option.
187176 """
188177 system = TelemetryHelper .get_driver_system_configuration ()
189178 candidates : Dict [str , Any ] = {
0 commit comments