PB-013: Fix local-parity defects that give wrong answers
Internal — engineering working material. This is a dated implementation, design, or planning record. Use the user guides for current instructions and check releases for shipped behavior.
State: Proposed. Not approved for implementation. Priority: P1 (mandatory: required). Owner when approved: Master product (unassigned; recommend the Prove program).
Re-checked 2026-10-25 at 524e6a3: Items 1, 2, 4 and 5 are fixed on main: variableLibrary runs locally (#410), a %%sql MERGE, UPDATE or DELETE raises instead of finishing ok, insertInto appends to an existing table, and scheduled runs skip frozen cells. Item 3 is fixed too: session (restartPython, stop), lakehouse and udf exist on this PC, and mount raises with the reason. warehouse and connections aren't in the notebook parity list of Fabric's notebookutils parts, so they need no message. Nothing is left to build; the item can go to review.
1. PR title and ID#
Fix five local notebook behaviors that differ silently from Fabric or the app (PB-013)
2. Business problem#
The product's promise is that work developed on the PC behaves predictably when it moves to Fabric. Five behaviors break that silently; each either reports success when nothing happened or blocks a notebook for the wrong reason.
3. Current verified behavior#
sidecar/fabric_desktop/fabric_run.py_FABRIC_ONLYtreatsnotebookutils.variableLibraryas Fabric-only, butnotebookutils_local.pyimplementsvariableLibraryfor VL_Sources.notebook.py(around line 411): a%%sqlcell with MERGE, UPDATE or DELETE prints a note and finishes with statusok, so Run all continues as if the write happened.notebookutils_local.py's docstring says Fabric-only parts "raise an error that says so", butsession,lakehouse,warehouse,udfandconnectionsare absent, giving a bare AttributeError.spark_local.py:insertInto = saveAsTable, and the writer's default mode iserrorifexists, sodf.write.insertInto(t)on an existing table raises; Spark'sinsertIntoappends.schedule_service.py_run_notebook_hereruns every code cell, including frozen ones;app/ui/notebook.jsskips frozen cells in a run (line 543).
Items 1-5 come from code reading at b7b04cc; none is covered by a test that asserts the
Fabric-matching behavior.
4. Desired behavior#
- variableLibrary notebooks are reported as able to run on the PC.
- Such cells end with a visible "skipped on this PC" state that stops Run all, with the reason.
- Each absent utility raises
NotImplementedErrorwith a sentence saying what to do instead. insertIntoappends by default and honorsoverwrite=True.- Scheduled runs skip frozen cells like the UI, and say how many were skipped.
5. In scope and out of scope#
In scope: the five fixes and their tests; notes in docs/notebooks.md.
Out of scope: running MERGE locally (PB-015); the AST analyzer (PB-014).
6. Architecture and files#
fabric_run.py, notebook.py, notebookutils_local.py, spark_local.py, schedule_service.py,
app/ui/notebook.js (display of the skipped state), tests in sidecar/tests/test_notebook.py,
test_notebook_parity.py, test_schedules.py.
7. Functional requirements#
As in section 4, one requirement per defect, each with a test.
8. Nonfunctional requirements#
No change to how cells run in Fabric. Messages in plain language.
9. Dependencies#
None. PB-014 builds on fix 1.
10. Security and compatibility#
A scheduled run that used to run a frozen cell will stop running it; release notes must say so.
Notebooks relying on insertInto raising will now append; release notes must say so.
11. Acceptance criteria#
- One failing-then-passing test per defect.
pytest sidecar/testsandnode --test app/tests/ui.test.cjspass.- Release notes list the two behavior changes.
12. Unit and integration tests#
Five new tests (compute check, %%sql write status, utility messages, insertInto append, frozen in schedules).
13. Manual verification#
On Windows: run a notebook with a frozen cell from Monitor > KratosForge > Schedules > Run now and confirm the frozen cell was skipped.
14. Documentation#
docs/notebooks.md local limits section.
15. Rollback#
Revert the PR; no data or format change.
16. Definition of Done#
Merged, tests green, FEAT-NB-07 moves from Implemented but Unreliable after review, release notes written.
Need a hand?
Find a fix in troubleshooting, or share a reproducible issue with the community.
Get support ↗Improve this guide on GitHub ↗