File tree Expand file tree Collapse file tree
src/databricks/sql/telemetry Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -122,6 +122,9 @@ def get_auth_flow(auth_provider):
122122
123123 @staticmethod
124124 def is_telemetry_enabled (connection : "Connection" ) -> bool :
125+ if getattr (connection .session , "use_kernel" , False ) is True :
126+ return False
127+
125128 # Fast path: force enabled - skip feature flag fetch entirely
126129 if connection .force_enable_telemetry :
127130 return True
Original file line number Diff line number Diff line change @@ -270,6 +270,14 @@ def test_token_federation_with_no_inner_provider(self):
270270 assert TelemetryHelper .get_auth_mechanism (fed ) is None
271271 assert TelemetryHelper .get_auth_flow (fed ) is None
272272
273+ def test_is_telemetry_enabled_returns_false_for_kernel (self ):
274+ connection = MagicMock ()
275+ connection .session .use_kernel = True
276+ connection .force_enable_telemetry = True
277+ connection .enable_telemetry = True
278+
279+ assert TelemetryHelper .is_telemetry_enabled (connection ) is False
280+
273281
274282class TestTelemetryFactory :
275283 """Tests for TelemetryClientFactory lifecycle and management."""
You can’t perform that action at this time.
0 commit comments