fix: restore auto-variadic socket state in remove_component - #12206
fix: restore auto-variadic socket state in remove_component#12206rautaditya2606 wants to merge 2 commits into
Conversation
|
@rautaditya2606 is attempting to deploy a commit to the deepset Team on Vercel. A member of the Team first needs to authorize it. |
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
|
@sjrl could you please take a look when you have some time? My impression is that the current fix is problematic and corrupts But you know this part better than me... |
309a149 to
147e038
Compare
Thanks for the feedback. I've updated the implementation so only the removed component's socket state is restored. Receiver sockets in the active pipeline are no longer modified. |
Related Issues
Proposed Changes
PipelineBase.remove_componentinhaystack/core/pipeline/base.pyto callsocket.__post_init__()and setsocket.wrap_input_in_list = Truewhen resetting input sockets of a removed component or when a receiver's remaining senders count drops totest_remove_component_resets_auto_variadic_socket_mutationintest/core/pipeline/test_pipeline_base.py.releasenotes/notes/.How did you test it?
All 149 pipeline base tests pass cleanly, formatting is verified, and
mypyreports zero issues.Notes for the reviewer
list[T]socket promotes it to auto-variadic (is_lazy_variadic=True,wrap_input_in_list=False).remove_componentonly setsocket.senders = [], leavingis_lazy_variadic=Trueandwrap_input_in_list=Falseintact. Reusing the component in a single-sender pipeline caused silent input processing bugs (unwanted flattening).socket.__post_init__()safely re-derives variadic status from the socket's declared type annotation, restoring default socket behavior.Checklist