Repository navigation
fix: prevent unhandled AssertionError in PipelineBase.__eq__ when comparing to non-Pipeline types - #12387
Merged
Conversation
…paring to non-Pipeline types
rautaditya2606
requested review from
julian-risch
and removed request for
a team
August 17, 2026 19:04
Contributor
|
@rautaditya2606 is attempting to deploy a commit to the deepset Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
This file contains hidden or 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
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
Closes #12386
Proposed Changes
if not isinstance(self, type(other))toif not isinstance(other, type(self))inPipelineBase.__eq__.assert isinstance(other, PipelineBase)check.object(), strings, ints,None, and list membership), and subclass comparisons.releasenotes/notes/fix-pipeline-base-eq-a665ea11824f86fb.yaml.How did you test it?
154 passed, 2 deselected in 4.56s.
Notes for the reviewer
Root cause:
PipelineBase.__eq__previously checkedisinstance(self, type(other))instead ofisinstance(other, type(self)). When aPipelineinstance was compared against any object whose type is a superclass ofPipeline(such asobject()),isinstance(self, object)evaluated toTrue. This bypassed the early return and hitassert isinstance(other, PipelineBase), raising an unhandledAssertionError.In Python,
__eq__must returnFalse(orNotImplemented) when comparing incompatible types and never raise anAssertionError.Reproducer:
The fix ensures
PipelineBase.__eq__adheres to Python's data model contract for equality comparisons.Checklist
releasenotes/notes/fix-pipeline-base-eq-a665ea11824f86fb.yaml)