ThreadRunner
kedro.runner.ThreadRunner ¶
ThreadRunner(max_workers=None, is_async=False)
Bases: AbstractRunner
ThreadRunner
is an AbstractRunner
implementation. It can
be used to run the Pipeline
in parallel groups formed by toposort
using threads.
Parameters:
-
max_workers
(int | None
, default:None
) –Number of worker processes to spawn. If not set, calculated automatically based on the pipeline configuration and CPU core count.
-
is_async
(bool
, default:False
) –If True, set to False, because
ThreadRunner
doesn't support loading and saving the node inputs and outputs asynchronously with threads. Defaults to False.
Raises: ValueError: bad parameters passed
Source code in kedro/runner/thread_runner.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
|
_get_executor ¶
_get_executor(max_workers)
Source code in kedro/runner/thread_runner.py
72 73 |
|
_get_required_workers_count ¶
_get_required_workers_count(pipeline)
Calculate the max number of processes required for the pipeline
Source code in kedro/runner/thread_runner.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
|
_run ¶
_run(pipeline, catalog, hook_manager=None, run_id=None)
The method implementing threaded pipeline running.
Parameters:
-
pipeline
(Pipeline
) –The
Pipeline
to run. -
catalog
(CatalogProtocol
) –An implemented instance of
CatalogProtocol
from which to fetch data. -
hook_manager
(PluginManager | None
, default:None
) –The
PluginManager
to activate hooks. -
run_id
(str | None
, default:None
) –The id of the run.
Raises:
-
Exception
–in case of any downstream node failure.
Source code in kedro/runner/thread_runner.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|