Skip to content

Commit ba6f5ee

Browse files
authored
feat: Make PipelineBase().validate_input public (#9520)
* Make validate_input public * Add reno
1 parent c5027d7 commit ba6f5ee

4 files changed

Lines changed: 9 additions & 3 deletions

File tree

haystack/core/pipeline/async_pipeline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ async def process_results():
198198
prepared_data = self._prepare_component_input_data(data)
199199

200200
# raises ValueError if input is malformed in some way
201-
self._validate_input(prepared_data)
201+
self.validate_input(prepared_data)
202202
inputs_state = self._convert_to_internal_format(prepared_data)
203203

204204
# For quick lookup of downstream receivers

haystack/core/pipeline/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ def _create_component_span(
899899
parent_span=parent_span,
900900
)
901901

902-
def _validate_input(self, data: Dict[str, Any]) -> None:
902+
def validate_input(self, data: Dict[str, Any]) -> None:
903903
"""
904904
Validates pipeline input data.
905905

haystack/core/pipeline/pipeline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def run( # noqa: PLR0915, PLR0912
172172
data = self._prepare_component_input_data(data)
173173

174174
# Raise ValueError if input is malformed in some way
175-
self._validate_input(data)
175+
self.validate_input(data)
176176

177177
if include_outputs_from is None:
178178
include_outputs_from = set()
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
enhancements:
3+
- |
4+
Make the PipelineBase().validate_input method public so users can use it with the confidence that it won't receive breaking changes without warning.
5+
This method is useful for checking that all required connections in a pipeline have a connection and is automatically called in the run method of Pipeline.
6+
It is being exposed as public for users who would like to call this method before runtime to validate the pipeline.

0 commit comments

Comments
 (0)