Commit 21c5c24
authored
Fix %run magic with databricks notebooks on windows (#1628)
## Changes
On windows `tempfile.NamedTemporaryFile` with `delete=True` (default)
deletes the temp file when it's closed. Internally the `%run` logic
opens and closes the file before execution (to check that it can open
it), which leads to deletion of the file and an error seen in #1624
Here we use lower-level temp file logic and unlink it ourselves after
the execution is fully done.
One more change is an installation of `nbformat` dependency at runtime
(together with `databricks-connect`), which is required for the `%run`
to work.
## Tests
e2e1 parent 60d5def commit 21c5c24
File tree
3 files changed
+31
-7
lines changed- packages/databricks-vscode
- resources/python
- src
- language
- test/e2e
3 files changed
+31
-7
lines changedLines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
228 | 232 | | |
229 | 233 | | |
230 | 234 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
53 | 59 | | |
54 | 60 | | |
55 | 61 | | |
| |||
Lines changed: 17 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
103 | 117 | | |
104 | 118 | | |
105 | 119 | | |
| |||
114 | 128 | | |
115 | 129 | | |
116 | 130 | | |
117 | | - | |
| 131 | + | |
118 | 132 | | |
119 | 133 | | |
120 | 134 | | |
| |||
288 | 302 | | |
289 | 303 | | |
290 | 304 | | |
291 | | - | |
| 305 | + | |
292 | 306 | | |
293 | | - | |
| 307 | + | |
294 | 308 | | |
295 | 309 | | |
0 commit comments