replaced JSON serialization with cloudpickle. This allows extracting a much
wider range of objects from the notebook subprocess.
Reference semantics have changed.
Old behavior of tb.get(name) and tb[name]:
a reference would be returned for non-JSON-serializable objects.
a value would be returned for JSON-serializable objects.
Old behavior of tb.ref(name) was identical to tb.get(name).
However, now almost all objects are serializable and as a result, under
the old semantics, a reference would almost never be returned. Therefore,
when a reference is desired, we now require explicitly requesting a
reference. The new behavior of tb.get(name) and tb[name] is to always
return the deserialized object and to never return a reference. The new
behavior of tb.ref(name) is to always return a reference.
I think this is a substantial improvement because:
this PR allows serializing a much wider range of objects
makes the API substantially clearer about when a reference will or will not be returned.
I understand that this is a mildly breaking change and adds a dependency and that must be weighed against the benefits. I would argue that the change is very worthwhile!
In my case, I wanted to be able to extract pandas DataFrames and various custom objects from a notebook under test.
See https://github.com/nteract/testbook/issues/138 for older discussion.
Copied from the changelog:
tb.get(name)
andtb[name]
:tb.ref(name)
was identical totb.get(name)
.tb.get(name)
andtb[name]
is to always return the deserialized object and to never return a reference. The new behavior oftb.ref(name)
is to always return a reference.I think this is a substantial improvement because:
I understand that this is a mildly breaking change and adds a dependency and that must be weighed against the benefits. I would argue that the change is very worthwhile!
In my case, I wanted to be able to extract pandas DataFrames and various custom objects from a notebook under test.