Skip to content

Commit 46ef531

Browse files
ai: apply changes for #925 (1 review thread)
Addresses: - #3877391550 at src/databricks/sql/session.py:290 Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>
1 parent 02002a1 commit 46ef531

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

src/databricks/sql/session.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -281,14 +281,23 @@ def _create_backend(
281281
"telemetry_batch_size": kwargs.get(
282282
"telemetry_batch_size", TelemetryClientFactory.DEFAULT_BATCH_SIZE
283283
),
284-
# Match the connector-wide True default (auth/common.py:55,
285-
# where ClientContext defaults telemetry_circuit_breaker_enabled
286-
# to True on the Thrift/SEA path). Forwarding an explicit default
287-
# here keeps parity with telemetry_batch_size above, rather than
288-
# passing None and letting the kernel silently pick its own
289-
# internal default.
284+
# Preserve the caller's explicit circuit-breaker choice. When
285+
# unset, leave it as None so the kernel owns the decision --
286+
# mirroring the enable_telemetry handling above rather than
287+
# forcing a default. This is deliberately NOT defaulted to True:
288+
# although ClientContext's signature default is True
289+
# (auth/common.py:55), the Thrift/SEA path never reaches it --
290+
# build_client_context (utils.py:1018) always passes
291+
# _telemetry_circuit_breaker_enabled explicitly (None when the
292+
# caller leaves it unset), and ClientContext coerces it with
293+
# bool(None) -> False (auth/common.py:89). So the *effective*
294+
# Thrift/SEA default when unset is False, not True; forwarding
295+
# True here would turn the circuit breaker on for an
296+
# unconfigured connection while Thrift/SEA leaves it off.
297+
# Passing None instead defers to the kernel's own default;
298+
# only an explicit caller value overrides it.
290299
"telemetry_circuit_breaker_enabled": kwargs.get(
291-
"_telemetry_circuit_breaker_enabled", True
300+
"_telemetry_circuit_breaker_enabled"
292301
),
293302
}
294303
return KernelDatabricksClient(

0 commit comments

Comments
 (0)