From 00eec5a2308f34b6ac5dc9b7072032fd46aa561d Mon Sep 17 00:00:00 2001 From: Shreyas Goenka Date: Tue, 12 Nov 2024 18:32:38 +0100 Subject: [PATCH] Address comments --- libs/filer/workspace_files_extensions_client.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/libs/filer/workspace_files_extensions_client.go b/libs/filer/workspace_files_extensions_client.go index 3d41701c5..53b77dd5b 100644 --- a/libs/filer/workspace_files_extensions_client.go +++ b/libs/filer/workspace_files_extensions_client.go @@ -80,14 +80,9 @@ func (w *workspaceFilesExtensionsClient) getNotebookStatByNameWithExt(ctx contex return nil, nil } - // When the extension is one of .py, .r, .scala or .sql we expect the export format to be source. + // For non-jupyter notebooks the export format should be source. // If it's not, return early. - if slices.Contains([]string{ - notebook.ExtensionPython, - notebook.ExtensionR, - notebook.ExtensionScala, - notebook.ExtensionSql}, ext) && - stat.ReposExportFormat != workspace.ExportFormatSource { + if ext != notebook.ExtensionJupyter && stat.ReposExportFormat != workspace.ExportFormatSource { log.Debugf(ctx, "attempting to determine if %s could be a notebook. Found a notebook at %s but it is not exported as a source notebook. Its export format is %s.", name, path.Join(w.root, nameWithoutExt), stat.ReposExportFormat) return nil, nil }