PySyft icon indicating copy to clipboard operation
PySyft copied to clipboard

Transforming a StorableObject to proto and back doesn't work

Open Benardi opened this issue 5 years ago • 2 comments

Description

Using _object2proto on a StorableObject to create a proto, and then using _proto2object on the result to create a StorableObject does not work

How to Reproduce

  1. Create a StorableObject
  2. Execute StorableObject._object2proto on it to create a proto object
  3. Execute StorableObject._proto2object on the proto object
  4. See error

Expected Behavior

At the end we should see a valid StorableObject

Screenshots

storable
<Storable: <UID: 7ceb6fe14a094ed7b85addfcf9de4068>>
(Pdb) proto_storable = StorableObject._object2proto(storable)
(Pdb) proto_storable
id {
  value: "\265\264\007\253\337>D\276\260]+`G\271\025~"
}
obj_type: "syft.core.store.storeable_object.StorableObject"
data {
  type_url: "type.googleapis.com/syft.core.common.UID"
  value: "\n\020|\353o\341J\tN\327\270Z\335\374\371\336@h"
}
description: "This is a dummy id"
tags: "dummy"
tags: "test"
type(proto_storable)
<class 'proto.core.store.store_object_pb2.StorableObject'>
StorableObject._proto2object(proto=proto_storable)
*** ValueError: bytes is not a 16-char string

System Information

  • OS: Ubuntu
  • OS Version: 18.04
  • Language Version: Python 3.8.5
  • Package Manager Version: pip 20.0.2

Benardi avatar Jan 20 '21 11:01 Benardi

@Benardi how does this look with the new https://github.com/OpenMined/PySyft/pull/5104 changes?

madhavajay avatar Feb 18 '21 23:02 madhavajay

Since we have completely overhauled the StorableObject code im going to assume this isn't an issue anymore. There

madhavajay avatar Feb 22 '21 06:02 madhavajay