Home:ALL Converter>How to use generators with kedro?

How to use generators with kedro?

Ask Time:2022-08-23T22:27:39         Author:ilja

Json Formatter

Thanks to David Beazley's slides on Generators I'm quite taken with using generators for data processing in order to keep memory consumption minimal. Now I'm working on my first kedro project, and my question is how I can use generators in kedro. When I have a node that yields a generator, and then run it with kedro run --node=example_node, I get the following error:

DataSetError: Failed while saving data to data set MemoryDataSet().
can't pickle generator objects

Am I supposed to always load all my data into memory when working with kedro?

Author:ilja,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/73460511/how-to-use-generators-with-kedro
yy