Skip to content

Commit 94e1853

Browse files
committed
telemetry for pyspark
1 parent 6ad8cb9 commit 94e1853

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/client/debugger/Main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,15 @@ export class PythonDebugger extends DebugSession {
188188
}
189189
else {
190190
// When using modules ensure the cwd has been provided
191-
if (typeof args.cwd !== 'string' || args.cwd.length === 0){
191+
if (typeof args.cwd !== 'string' || args.cwd.length === 0) {
192192
return this.sendErrorResponse(response, 2001, `'cwd' in 'launch.json' needs to point to the working directory`);
193193
}
194194
}
195195
this.sendEvent(new TelemetryEvent(telemetryContracts.Debugger.Load, {
196196
Debug_Console: args.console,
197197
Debug_DebugOptions: args.debugOptions.join(","),
198198
Debug_DJango: args.debugOptions.indexOf("DjangoDebugging") >= 0 ? "true" : "false",
199+
Debug_PySpark: typeof args.pythonPath === 'string' && args.pythonPath.indexOf('spark-submit') > 0 ? 'true' : 'false',
199200
Debug_HasEnvVaraibles: args.env && typeof args.env === "object" ? "true" : "false"
200201
}));
201202

src/client/extension.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@ let jupMain: jup.Jupyter;
3535

3636
export function activate(context: vscode.ExtensionContext) {
3737
let pythonSettings = settings.PythonSettings.getInstance();
38+
const hasPySparkInCompletionPath = pythonSettings.autoComplete.extraPaths.some(p => p.toLowerCase().indexOf('spark') >= 0);
3839
telemetryHelper.sendTelemetryEvent(telemetryContracts.EVENT_LOAD, {
3940
CodeComplete_Has_ExtraPaths: pythonSettings.autoComplete.extraPaths.length > 0 ? 'true' : 'false',
40-
Format_Has_Custom_Python_Path: pythonSettings.pythonPath.length !== 'python'.length ? 'true' : 'false'
41+
Format_Has_Custom_Python_Path: pythonSettings.pythonPath.length !== 'python'.length ? 'true' : 'false',
42+
Has_PySpark_Path: hasPySparkInCompletionPath ? 'true' : 'false'
4143
});
4244
lintingOutChannel = vscode.window.createOutputChannel(pythonSettings.linting.outputWindow);
4345
formatOutChannel = lintingOutChannel;

0 commit comments

Comments
 (0)