Skip to content
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: deepcopy the inputs of components #6987

Merged
merged 3 commits into from
Feb 16, 2024

Conversation

anakin87
Copy link
Member

@anakin87 anakin87 commented Feb 14, 2024

Related Issues

Proposed Changes:

Previously, when using the same input reference in different components, the Pipeline run logic had an unexpected behavior (see the original issue). This has been fixed by deepcopying the inputs before passing them to the components.

How did you test it?

CI, new test

Notes for the reviewer

  • I would be happy to discuss better solutions together
  • Simply doing data=deepcopy(data) does not fix the issue.
    I think this happens because the same internal structure is reproduced, so if comp1 and comp2 share the same input reference, this also happens after deepcopy (comp1 and comp2 refer to the same deepcopied input)

Checklist

@github-actions github-actions bot added topic:tests 2.x Related to Haystack v2.0 topic:core labels Feb 14, 2024
@coveralls
Copy link
Collaborator

coveralls commented Feb 14, 2024

Pull Request Test Coverage Report for Build 7899489175

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.004%) to 88.921%

Files with Coverage Reduction New Missed Lines %
core/pipeline/pipeline.py 3 94.26%
Totals Coverage Status
Change from base Build 7889210421: 0.004%
Covered Lines: 4880
Relevant Lines: 5488

💛 - Coveralls

@anakin87 anakin87 requested a review from masci February 14, 2024 10:03
@anakin87 anakin87 marked this pull request as ready for review February 14, 2024 10:03
@anakin87 anakin87 requested review from a team as code owners February 14, 2024 10:03
@anakin87 anakin87 requested review from dfokina and vblagoje and removed request for a team and vblagoje February 14, 2024 10:03
@silvanocerza silvanocerza merged commit 3f85a63 into main Feb 16, 2024
34 of 36 checks passed
@silvanocerza silvanocerza deleted the pipeline-same-input-ref-different-components branch February 16, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Related to Haystack v2.0 topic:core topic:tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Passing the same input to different Components causes unexpected behavior
3 participants