Marwan Sarieddine
03/04/2021, 4:53 PM0.14.11
that made the Flow object no longer pickleable using pickle
- I am wondering if others have bumped into thisMarwan Sarieddine
03/04/2021, 4:53 PMlambda
in Flow.___init___
in self.__slug__counters
which raises this error
AttributeError: Can't pickle local object 'Flow.__init__.<locals>.<lambda>'
Marwan Sarieddine
03/04/2021, 4:54 PMFlow.___init___
(prefect/core/flow.py
)
self._slug_counters = collections.defaultdict(
lambda: itertools.count(1)
) # type: Dict[str, Iterator[int]]
Marwan Sarieddine
03/04/2021, 4:54 PMMarwan Sarieddine
03/04/2021, 4:55 PMdef count():
return itertools.count(1)
self._slug_counters = collections.defaultdict(count)
Marwan Sarieddine
03/04/2021, 4:55 PMSamuel Hinton
03/04/2021, 4:59 PMMarwan Sarieddine
03/04/2021, 5:01 PMpickle
- sadly we are constrained to using pickle since we are using a prefect flow as part of a tensorflow 2.0 trainingSamuel Hinton
03/04/2021, 5:02 PMMarwan Sarieddine
03/04/2021, 5:24 PMFlow
and adjusting the subclassed.__init__
accordinglyJim Crist-Harif
03/04/2021, 5:25 PM@task
created task), so in practice pickle-only support is not a priority for us. That said, we'd accept a simple fix if you want. I'd use a partial
here instead to avoid defining a top-level function.Marwan Sarieddine
03/04/2021, 5:34 PMMarwan Sarieddine
03/04/2021, 6:40 PM