mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-10 04:19:48 -06:00
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:
@@ -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();
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user