Engine: python.set keeps a cell's result only for the same code and return type

python.set kept the stored result whenever the code was unchanged, also when
the call switched the return type between an Excel value and a Python object.
The cell then showed a value and preview of the other type, and a save wrote
the new type with that old cached value. The result is now kept only when both
the code and the return type match; otherwise the cell is new code, which
shows #BLOCKED! until it runs, and its old spill goes with its readers
recalculated.
This commit is contained in:
prxnvt
2026-11-01 15:11:59 -05:00
parent 11b55e0c71
commit 0151f43af8
3 changed files with 29 additions and 3 deletions
+1 -1
View File
@@ -373,7 +373,7 @@ fn save_model_asks_before_it_writes_over_a_python_cell_that_shows_nothing() {
}
/// A1 is a Python cell whose kept result `[5, 6]` spills over A1:A2, and B1 reads A2.
fn spill_with_a_reader() -> crate::Session {
pub(super) fn spill_with_a_reader() -> crate::Session {
let mut s = s();
s.execute("python.set", json!({"cell": "A1", "code": "[5, 6]"})).unwrap();
{