uqfoundation/dill

Unable to get repr for xxx when deserialize with dill

Opened this issue · 1 comments

Currently, we have a test class that can be serialized, however, when we try to deserialize, it shows this error message: Unable to get repr for xxx

I looked into the serialization and found there were a couple of fields were missing.
And the main reason is that we use Protocol in the test class which causes the problem, could you please let us know the workaround for this issue?

@dataclass
class bean(BasicBean):
    agencyCode: str
    remittanceFrequency: str
    paye: str
    pswd: str
    cert: str
    docs: list[Protocol] = field(default_factory=list)

When we deserialize, we can only get partial outputs, not sure the root cause.

This is the serialize results:
b'\x80\x04\x95h\x00\x00\x00\x00\x00\x00\x00\x8c5my_module.countries.ireland.data_beans\x94\x8c\x13Bean\x94\x93\x94)\x81\x94\x8c\x0cie_ri_agency\x94]\x94\x86\x94b.'

So there are a lot of data is missing in the serialization.

I looked into deeper, seems like there is a hard time for dill to understand the:
Protocol in the typing_extensions