-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Fix/informative error message #9661
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/informative error message #9661
Conversation
Pull Request Test Coverage Report for Build 16902023987Details
💛 - Coveralls |
Hey @sjrl , On the first recommended error message when
do you think this would be a more clear error message:
ReasonI was debugging the test : With the current error message this is what it looks like
and I thought this would add more clarity
Would love to hear your thoughts on this |
Great catch! Yes that would be a much better error message to provide. So let's go with your suggestion for this third case. |
I do apologize for disabling
|
hey @sjrl , upon further review, I would recommend not adding the When we create a component with no input sockets def test_connect_with_receiver_component_with_no_input_sockets():
"""
Test connecting to a component that has no input sockets.
Should raise PipelineConnectError.
"""
@component
class NoInputComponent:
@component.output_types(result=int)
def run(self, result: int):
return {"result": result}
comp1 = component_class("Comp1", output_types={"value": int})()
comp2 = NoInputComponent()
pipe = PipelineBase()
pipe.add_component("comp1", comp1)
pipe.add_component("comp2", comp2) We get a TypeError since we are trying to pass in an arg for a component that doesn't have any params
this means if we add the Though adding a test to assert this behaviour( Would love to hear your thoughts. |
Hmm I think the test is failing with this TypeError because the
However, thinking more on this I don't think this check makes sense since input types of components are automatically set based on the input signature of the run method so theoretically |
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.
Thanks for your work on this!
Related Issues
Proposed Changes:
Made the error more descriptive using the formatted recommended by @sjrl .
How did you test it?
Notes for the reviewer
Checklist
fix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
and added!
in case the PR includes breaking changes.