ExplainaBoard icon indicating copy to clipboard operation
ExplainaBoard copied to clipboard

Avoid serializing functions

Open odashi opened this issue 2 years ago • 3 comments

Current serialization attempt to serialize functions via inspect.getsource:

https://github.com/neulab/ExplainaBoard/blob/df48ff1792bd912087ba644cae695181e6f26e67/explainaboard/serialization/legacy.py#L26-L27

However, this function supports only limited cases: given callables have to be represented as a substantial source, and builtin/synthesized functions can't be supported. Basically we don't have complete way to serialize functions.

In addition, storing runnable code to loadable data is dangerous because it opens a door to attack the system. If we don't have any special demands, it is better to avoid this functionality from the codebase.

RFC: @neubig

odashi avatar Sep 10 '22 00:09 odashi

I think that's fine. This serialization was more for reference, and I never intended the code to be deserialized and used.

neubig avatar Sep 10 '22 01:09 neubig

Is there no utilization of this feature? If so we can just remove this.

odashi avatar Sep 10 '22 04:09 odashi

Yeah, I think it can be removed for now.

neubig avatar Oct 10 '22 15:10 neubig