The notebookutils release. The shim a Fabric notebook imports went from
partial and partly-wrong to the whole documented surface — 44 members across 8
namespaces, each exercised end to end — and closing it turned up ten defects
that unit tests could not see.
⚠️ Upgrade first for this
notebookutils.fs.rm(path) on a directory deleted the entire subtree.
OneLake's DELETE ignored ?recursive= completely, so a bare rm took the tree
with it. ADLS Gen2 answers 409 DirectoryNotEmpty; the emulator was more
destructive than the thing it emulates, on the one filesystem operation with no
undo. Fixed: a non-empty directory is now refused unless recurse=True.
Breaking changes
All are corrections toward Fabric's documented contract — a framework
introspects these signatures and refuses to start when a parameter name differs
— but code written against v0.33.0 may need edits.
| v0.33.0 | v0.34.0 | Note |
|---|---|---|
fs.put(path, content, overwrite=True) |
put(file, content, overwrite=False) |
default changed; an overwrite must now be asked for |
fs.append(path, content) |
append(file, content, createFileIfNotExists=False) |
|
fs.head(path, maxBytes=) |
head(file, max_bytes=) |
|
fs.cp(src, dst) / mv |
cp(src, dest) / mv |
|
fs.rm(dir) removed subtrees |
rm(path, recurse=False) refuses a non-empty directory |
see above |
lakehouse.get(lakehouseId) |
get(name) |
addressed by NAME, as documented; an id still resolves |
Positional callers are mostly unaffected; callers passing these by keyword are
not.
Fixed
fs.rmdestroyed directory trees (above).session.stop()andsession.restartPython()never worked inside a
session. Both read environment variables that nothing in the tree ever set,
so they raised "this is running outside a notebook session" — inside one.
They are now bound per statement, because one agent serves many concurrent
sessions and a process variable would letstop()in one notebook end
another's.restartPython()left the session withoutdisplay,displayHTMLand
%run. Those are kernel builtins on Fabric; a Python restart cannot remove
them.- A referenced notebook resolved
builtin/to its own folder.nbResPath
means the ROOT notebook's resources, and nothing ever sent a root — so a
notebook read different files depending on how it was started. - A cell's language was classified and then ignored. The run loop sent
everything that was notsqlto the Python executor, so correct Scala failed
with a PythonSyntaxErrorpointing at the user's own code, and a
%%configureblock of JSON failed the same way. - The long-running-operation
Locationheader always saidhttps://, so a
client following it — the documented route to a result — could not reach an
emulator started with-disable-tls. display()anddisplayHTML()were absent entirely, raisingNameError
on one of the most common lines in any Fabric notebook.
Added
- The whole documented
notebookutilssurface: 44 members overfs,
notebook,credentials,lakehouse,runtime,session,udfand
variableLibrary, with the documented parameter names in the documented
order. Every member is exercised end to end, not merely present. help()on every module, plusgetHelpString— the discovery mechanism
Fabric's ownfspage opens by documenting. Derived by introspection, so it
cannot drift from the code.- Notebook item management (
create,get,list,update,delete,
getDefinition,updateDefinition),lakehousedefinition round-trips,
udf.run,runtime.getCurrentWorkspaceId,fs.refreshMounts. display()publishes rich output under a kernel —text/htmlwith a
text/plainalternative — and prints without one. The shipped JupyterLab
binds Fabric'sdisplay, not IPython's.- Microsoft's own stubs are vendored (
third_party/notebookutils-stubs/)
and held beside the documentation, so where the two Microsoft sources
disagree the divergence is computed rather than assumed.
Honest limits
display() renders a correct HTML table, not Fabric's interactive widget
with its chart views and inspect panel; no local front end can prove
equivalence with that. The Files mount is a point-in-time copy, not blobfuse.
%%configure is accepted and ignored, out loud. Scala, R and C# cells are
refused by name rather than mis-executed.
And the standing one: everything here is verified against Microsoft's published
contract, not against a tenant. It means conforms to the documentation — never
matches Fabric.