bundle: preserve .designer.ipynb suffix when translating notebook task paths#5370
Open
artchen-db wants to merge 1 commit into
Open
bundle: preserve .designer.ipynb suffix when translating notebook task paths#5370artchen-db wants to merge 1 commit into
.designer.ipynb suffix when translating notebook task paths#5370artchen-db wants to merge 1 commit into
Conversation
…ask paths Lakeflow Designer files keep their full `.designer.ipynb` suffix when imported into the workspace, unlike regular notebooks (`.py`, `.ipynb`, `.r`, `.scala`, `.sql`) which lose their extension. `translateNotebookPath` unconditionally stripped `path.Ext(localRelPath)` — which is `.ipynb` for a `foo.designer.ipynb` path — leaving `foo.designer` and pointing the job's `notebook_path` at a file that does not exist. Add `notebook.ExtensionDesigner` and a `StripExtension` helper that special-cases the designer suffix. Apply it in both branches of `translateNotebookPath` (the `skipLocalFileValidation` branch and the post-detection branch). Reproduces with a bundle that has `tasks[].notebook_task.notebook_path: ./foo.designer.ipynb`: before this change the file synced as `foo.designer.ipynb` (correct, type `DESIGNER_FILE`) but the deployed job pointed at `foo.designer` (404). After this change the job points at `foo.designer.ipynb`.
Contributor
|
An authorized user can trigger integration tests manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
Contributor
Approval status: pending
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lakeflow Designer files keep their full
.designer.ipynbsuffix when imported into the workspace, unlike regular notebooks (.py,.ipynb,.r,.scala,.sql) which lose their extension on import.translateNotebookPathinbundle/config/mutator/translate_paths.gounconditionally strippedpath.Ext(localRelPath). For afoo.designer.ipynbpath,path.Extreturns.ipynb, leavingfoo.designer— the deployed job'snotebook_paththen points at a file that does not exist.Fix
Add
notebook.ExtensionDesigner = ".designer.ipynb"and aStripExtensionhelper inlibs/notebook/ext.gothat special-cases the designer suffix. Apply it in both branches oftranslateNotebookPath(theskipLocalFileValidationbranch and the post-detection branch).Reproduction
A bundle with:
foo.designer.ipynb(DESIGNER_FILE) ✓foo.designer.ipynb(DESIGNER_FILE) ✓notebook_pathfoo.designer→ 404 ✗foo.designer.ipynb✓Tests
libs/notebook/ext_test.go—TestStripExtensioncovers.py / .ipynb / .r / .scala / .sql, the.designer.ipynbkeep-case, and no-extension input.bundle/config/mutator/translate_paths_test.go—TestTranslatePathsDesignerNotebook(file present, mixed designer + regular tasks) andTestTranslatePathsDesignerNotebookSkipLocalFileValidation(config-remote-sync branch). Both assert designer suffix is preserved and.py/.ipynbare still stripped.Out of scope
Other call sites strip
path.Extin the same pattern (libs/sync/snapshot_state.go,bundle/generate/downloader.go,cmd/workspace/workspace/import_dir.go,libs/filer/workspace_files_extensions_client.go). The job-task path covers the reported user-visible bug; whether designer files need the same special-case in sync / generate / import-dir flows depends on whether they round-trip through those paths in a way the workspace API doesn't already handle. Happy to extend in a follow-up if reviewers want.