diff --git a/haystack/core/pipeline/pipeline.py b/haystack/core/pipeline/pipeline.py index 59a21540d8..54d3be09ad 100644 --- a/haystack/core/pipeline/pipeline.py +++ b/haystack/core/pipeline/pipeline.py @@ -25,13 +25,18 @@ class Pipeline(PipelineBase): def _component_has_enough_inputs_to_run(self, name: str, last_inputs: Dict[str, Dict[str, Any]]) -> bool: """ Returns True if the Component has all the inputs it needs to run. + + :param name: Name of the Component as defined in the Pipeline. + :param last_inputs: The current state of the inputs divided by Component name. + + :return: Whether the Component can run or not. """ instance: Component = self.graph.nodes[name]["instance"] if name not in last_inputs: return False - expected_inputs = set(instance.__haystack_input__._sockets_dict.keys()) # type: ignore - current_inputs = set(last_inputs[name].keys()) - if expected_inputs != current_inputs: # type: ignore + expected_inputs = instance.__haystack_input__._sockets_dict.keys() # type: ignore + current_inputs = last_inputs[name].keys() + if expected_inputs != current_inputs: return False return True