-
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
chore: Simplify Pipeline.run
method by moving code to the base class
#7680
Conversation
# TODO: Support also this format: | ||
# data = { | ||
# "input1": 1, "input2": 2, | ||
# } |
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.
This comment was outdated
# This implementation of run supports only the first format, but the second format is actually | ||
# never received by this method. It's handled by the `run()` method of the `Pipeline` class | ||
# defined in `haystack/pipeline.py`. | ||
# As of now we're ok with this, but we'll need to merge those two classes at some point. |
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.
This comment was outdated
pipe.connect("greet", "adder") | ||
pipe._init_graph() | ||
for node in pipe.graph.nodes: | ||
assert pipe.graph.nodes[node]["visits"] == 0 |
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.
Should I do the same for the newly added private methods?
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.
Yeah, that would be cool.
Pull Request Test Coverage Report for Build 9086069754Warning: 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 |
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.
I added the tests, approving and merging. 🤝
Proposed Changes:
This PR has the only purpose to clean up the logic of the
run
method by moving code around, no functional changes.It should also make the code more testable, but knowing we have #7611 pending, I'm not touching them.
There's more code to move, but I want to keep the diff small to speed up the review process.
How did you test it?
Existing tests
Notes for the reviewer
Checklist
fix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
.