-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Fix running Pipeline
with conditional branch and Component with default inputs
#7799
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
silvanocerza
requested review from
dfokina and
masci
and removed request for
a team
June 4, 2024 10:04
Pull Request Test Coverage Report for Build 9401345309Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
silvanocerza
force-pushed
the
fix-conditional-branching
branch
from
June 5, 2024 10:39
2a10e65
to
fbee12a
Compare
shadeMe
suggested changes
Jun 6, 2024
haystack/core/pipeline/base.py
Outdated
@@ -719,7 +719,7 @@ def _init_inputs_state(self, data: Dict[str, Dict[str, Any]]) -> Dict[str, Dict[ | |||
|
|||
return {**data} | |||
|
|||
def _init_to_run(self) -> List[Tuple[str, Component]]: | |||
def _init_to_run(self, data: Dict[str, Any]) -> List[Tuple[str, Component]]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use a better name than data
. pipeline_inputs
?
shadeMe
approved these changes
Jun 6, 2024
vblagoje
pushed a commit
that referenced
this pull request
Jul 3, 2024
…h default inputs (#7799) * Fix running Pipeline with conditional branch and Component with default inputs * Add release notes * Change arg name of _init_to_run so it's clearer * Enhance release note
vblagoje
pushed a commit
that referenced
this pull request
Jul 3, 2024
…h default inputs (#7799) * Fix running Pipeline with conditional branch and Component with default inputs * Add release notes * Change arg name of _init_to_run so it's clearer * Enhance release note
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related Issues
Fixes
Proposed Changes:
This PR changes a bit how we collect the initial list of Component that can run when calling
Pipeline.run()
.Instead of getting only Component that have no inputs, or have a least one input that is not connected or is variadic, we also get Components that receive inputs from the user.
It also changes how we handle conditional outputs. Now if a Component with a conditional output runs and doesn't send anything to a certain socket we remove from
to_run
andwaiting_for_input
all the Components connected to that socket.How did you test it?
I updated tests locally and ran unit,
Pipeline.run()
and e2e tests.Notes for the reviewer
N/A
Checklist
fix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
.