dispatchrun / dispatch

Entrypoint of the Dispatch ecosystem.
11 stars 1 forks source link

run: improve formatting of Python input/output values #50

Closed chriso closed 5 months ago

chriso commented 5 months ago

The pickle library we're using (gopickle) uses a types.GenericClass and types.GenericObject to represent custom classes and objects found in a pickle stream. For the common case where the class is a @dataclass, these types aren't sufficient; an error occurs when the pickle library tries to set __dict__ properties, since *types.GenericObject doesn't implement types.PyDictSettable. This PR updates the formatter to instead use a custom generic object type which implements PyDictSettable. The result is that we can properly format data classes.

I've also updated the formatting layer to log more information when it encounters a Python value it can't parse.