Manuel Mourato
05/07/2020, 6:08 PMrv = reduce(self.proto)
File "stringsource", line 2, in jnius.JavaClass.__reduce_cython__
TypeError: no default __reduce__ due to non-trivial __cinit__
A Cython object as far as I was able to search cannot be pickeled, unless specific code is add like so :
https://stackoverflow.com/questions/12646436/pickle-cython-class
My goal here, is to store this flow so that I can run an agent which will then execute it when I run via the UI. If I just register the flow in the UI , but dont save it, I get this error:
[2020-05-07 17:43:48,846] INFO - agent | flow = storage.get_flow(storage.flows[flow_data.name])
[2020-05-07 17:43:48,846] INFO - agent | KeyError: 'Test-Flow55'
My question is: did someone have an issue like this before? Can I get around this in some way?Jenny
05/07/2020, 6:32 PMManuel Mourato
05/07/2020, 6:33 PMJenny
05/07/2020, 6:57 PMManuel Mourato
05/07/2020, 7:06 PMJenny
05/07/2020, 7:07 PMManuel Mourato
05/07/2020, 7:09 PMJenny
05/07/2020, 7:26 PMLaura Lorenz (she/her)
05/07/2020, 7:59 PMflow.save
directly, but in the end no matter how you slice it at some point your flow object will be pickled to be placed in storage if you want to use it with Cloud or Prefect Core’s server.
Since the flow object itself must be pickleable, the tasks attached to them must be pickleable too, though they may produce unpickleable things during task run method since the run method is not executed until later. So, if you can defer the instantiation of whatever it is that is unpickleable until the task’s run method, then you’d be ok. (Which I think as you mention in this case is the Cython object, though tbh I don’t 100% understand the exception you’ve got)Jenny
05/07/2020, 8:05 PMManuel Mourato
05/07/2020, 9:47 PM