You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let me preface this by saying that I could not possibly care less about this issue — I'm always amazed that anyone still uses pickle at all, anymore. Using it to serialize Pydot data seems especially silly, because it makes far more sense to just serialize as a dot file and re-parse it on load, if someone really needs to store their graphs.
But, it's something I discovered in experimenting, so I wanted to at least document it. I don't have any plans to fix it, heck I'm not even sure if it is fixable.
Because complex edges are partly made up of FrozenDict objects, graphs that include them are no longer picklable. Writing out the data will work fine, but when attempting to load it back in Python will throw out a Traceback originating in:
AttributeError: Afrozendictcannotbemodified.
(Including the incorrect casing; I forgot to update the message when I renamed the class to FrozenDict.)
AFAICT it's always been this way... I loaded up Pydot v1.4.2 and attempted to pickle a frozendict from that version of the code, and got the same exact traceback.
The only difference is, now that we support complex edges, there will beFrozenDicts in the graph data. There never were, before, because they're only used for subgraphs on edge endpoints.
This issue only affects graphs that use complex edges, for the same reason. So, as far as I care, that's fine: Complex edges are incompatible with pickle, so users can choose one or the other (or neither). ¯\_(ツ)_/¯
The text was updated successfully, but these errors were encountered:
I foresee a possibility of user-friendly pickling errors when a complex edge is detected in the graph, implemented in the __getstate__ method. That's probably a feature that nobody will ever use.
Let me preface this by saying that I could not possibly care less about this issue — I'm always amazed that anyone still uses pickle at all, anymore. Using it to serialize Pydot data seems especially silly, because it makes far more sense to just serialize as a dot file and re-parse it on load, if someone really needs to store their graphs.
But, it's something I discovered in experimenting, so I wanted to at least document it. I don't have any plans to fix it, heck I'm not even sure if it is fixable.
Because complex edges are partly made up of
FrozenDict
objects, graphs that include them are no longer picklable. Writing out the data will work fine, but when attempting to load it back in Python will throw out a Traceback originating in:(Including the incorrect casing; I forgot to update the message when I renamed the class to
FrozenDict
.)AFAICT it's always been this way... I loaded up Pydot v1.4.2 and attempted to pickle a
frozendict
from that version of the code, and got the same exact traceback.The only difference is, now that we support complex edges, there will be
FrozenDict
s in the graph data. There never were, before, because they're only used for subgraphs on edge endpoints.This issue only affects graphs that use complex edges, for the same reason. So, as far as I care, that's fine: Complex edges are incompatible with pickle, so users can choose one or the other (or neither).
¯\_(ツ)_/¯
The text was updated successfully, but these errors were encountered: