You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Preserve .designer.ipynb suffix when translating notebook task paths (#5370)
## Summary
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 on import.
`translateNotebookPath` in `bundle/config/mutator/translate_paths.go`
unconditionally stripped `path.Ext(localRelPath)`. For a
`foo.designer.ipynb` path, `path.Ext` returns `.ipynb`, leaving
`foo.designer` — the deployed job's `notebook_path` then points at a
file that does not exist.
## Fix
Add `notebook.ExtensionDesigner = ".designer.ipynb"` and a
`StripExtension` helper in `libs/notebook/ext.go` that special-cases the
designer suffix. Apply it in both branches of `translateNotebookPath`
(the `skipLocalFileValidation` branch and the post-detection branch).
## Reproduction
A bundle with:
```yaml
resources:
jobs:
designer_job:
tasks:
- task_key: t
notebook_task:
notebook_path: ./foo.designer.ipynb
```
| | Before | After |
|---|---|---|
| File in workspace | `foo.designer.ipynb` (`DESIGNER_FILE`) ✓ |
`foo.designer.ipynb` (`DESIGNER_FILE`) ✓ |
| Deployed `notebook_path` | `foo.designer` → 404 ✗ |
`foo.designer.ipynb` ✓ |
## Tests
- `libs/notebook/ext_test.go` — `TestStripExtension` covers `.py /
.ipynb / .r / .scala / .sql`, the `.designer.ipynb` keep-case, and
no-extension input.
- `bundle/config/mutator/translate_paths_test.go` —
`TestTranslatePathsDesignerNotebook` (file present, mixed designer +
regular tasks) and
`TestTranslatePathsDesignerNotebookSkipLocalFileValidation`
(config-remote-sync branch). Both assert designer suffix is preserved
and `.py` / `.ipynb` are still stripped.
## Out of scope
Other call sites strip `path.Ext` in 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.
Copy file name to clipboardExpand all lines: NEXT_CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,5 +9,6 @@
9
9
10
10
### Bundles
11
11
* Retry transient HTTP 504 Gateway Timeout errors in direct deployment engine ([#5349](https://github.com/databricks/cli/pull/5349)).
12
+
* Preserve `.designer.ipynb` suffix when translating notebook task paths so Lakeflow Designer files referenced from a `notebook_task` resolve correctly in the workspace ([#5370](https://github.com/databricks/cli/pull/5370)).
0 commit comments