haystack icon indicating copy to clipboard operation
haystack copied to clipboard

Rename `Pipeline.run()` argument `max_loops_allowed` as it is misleading

Open silvanocerza opened this issue 1 year ago • 1 comments

Summary and motivation

The name max_loops_allowed is misleading when calling Pipeline.run() as it doesn't limit the number of times a cycle in the Pipeline graph is executed.

Instead it limits the number of times a single Component can run. This is misleading for the user and we should rename it to something more sensible. max_run_per_component could be a good alternative.

We should deprecate max_loops_allowed to start with.

silvanocerza avatar Aug 27 '24 08:08 silvanocerza

I agree that the name is misleading. At least the docstring we have explains it better. :param max_loops_allowed: How many times the pipeline can run the same node before throwing an exception.

Isn't max_loops_allowed still functioning as an upper limit for the number of times a cycle in the Pipeline graph is executed? You're saying

it doesn't limit the number of times a cycle in the Pipeline graph is executed.

Yet Haystack won't execute a cycle more often than max_loops_allowed right?

julian-risch avatar Aug 28 '24 06:08 julian-risch