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
The tuple is serializable but gets deserialized back to a list
Set is not serializable at all
Datetime also not serializable:
I think we can add support for these by doing some custom encoding parameters similar to what we did for Pandas in MesopJSONEncoder
For set and tuple, probably can do something like:
if isinstance(obj, set):
return {"[set]": obj}
Then in decode_mesop_json_state_hook
if "[set]" in dct:
return set(dct["[set]"]),
``
Haven't tested it though. Depends on how the encode decoding works. If it works it's way upwards, then this should work. But if the serialization/deserialization works from root to leaf, then wouldn't work for nested types. But I imagine it should work from leaf to root
--------
Datetime would be similar I think. But need to determine the format we want to store the date as. Some ISO standard or unix timetamp. Maybe some kind of ISO standard especially if we need to handle time zones.
----
Code link: https://github.com/google/mesop/blob/main/mesop/dataclass_utils/dataclass_utils.py
The text was updated successfully, but these errors were encountered:
Someone was working on this. They did the datetime part. I don't know if they plan to come back to work on the set / tuple, so you may want to wait a week before attempting this.
Also the implementation for tuple may not be straightforward.
I think we can add support for these by doing some custom encoding parameters similar to what we did for Pandas in
MesopJSONEncoder
For set and tuple, probably can do something like:
Then in
decode_mesop_json_state_hook
The text was updated successfully, but these errors were encountered: