Skip to content

fix: preserve Callable signatures in pipeline error messages - #13747

Open
AkilLabs wants to merge 1 commit into
deepset-ai:mainfrom
AkilLabs:fix/callable-type-names
Open

AkilLabs wants to merge 1 commit into
deepset-ai:mainfrom
AkilLabs:fix/callable-type-names

Conversation

@AkilLabs

Copy link
Copy Markdown

Related Issues

No existing matching issue found. This fixes a reproducible diagnostic problem in Pipeline.connect().

Proposed Changes:

Connecting an output typed as Callable[[int], str] to an input typed as Callable[[str], str] correctly raises PipelineConnectError, but both sockets are displayed as Callable[, str]. The error therefore hides the incompatible parameter types.

Format the parameter list and return type of a Callable separately. The error now displays Callable[[int], str] and Callable[[str], str]. Empty parameter lists, ellipses, nested callbacks, and None return types are preserved too; ParamSpec and Concatenate remain supported. Connection compatibility rules are unchanged.

Includes a regression test through Pipeline.connect(), formatting tests for both typing.Callable and collections.abc.Callable, and a release note.

How did you test it?

  • Before the fix: 13 new regression cases failed; the two parameter-specification cases already passed.
  • hatch run test:unit test/core/test_type_utils.py test/core/pipeline/test_pipeline_base.py --no-cov -q --tb=short: 1,285 passed, 2 deselected.
  • hatch run test:types haystack/core/type_utils.py test/core/test_type_utils.py test/core/pipeline/test_pipeline_base.py: no issues in 3 source files.
  • Repository pre-commit hooks passed for all four changed files.

Validated on Linux with Python 3.12. The full repository suite and live integration tests were not run.

Notes for the reviewer

This PR was fully generated with an AI assistant, which reviewed the diff and ran the checks listed above. No personal human review is claimed.

Checklist

  • Read the contribution guidelines and code of conduct.
  • Added regression tests and updated the helper's docstring.
  • Used a conventional commit title.
  • Added a release note.
  • Ran the repository pre-commit hooks.
  • Related issue update: not applicable; reproduction and validation are described above.

@AkilLabs
AkilLabs requested a review from a team as a code owner November 14, 2026 11:00
@AkilLabs
AkilLabs requested review from davidsbatista and removed request for a team November 14, 2026 11:00
@vercel

vercel Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

@AkilLabs is attempting to deploy a commit to the deepset Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant

CLAassistant commented Nov 14, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@HaystackBot

Copy link
Copy Markdown
Contributor

Hi @AkilLabs, thanks a lot for your contribution! 🙏

We noticed that the Contributor License Agreement (CLA) check (license/cla) hasn't passed yet, so we've temporarily moved this PR to draft and paused the review assignment.

To get your PR reviewed, please sign the CLA via the link in the license/cla check below (or in the CLA bot comment). As soon as the check turns green, this PR will automatically be marked ready for review again and a reviewer will be re-assigned.

@HaystackBot
HaystackBot removed the request for review from davidsbatista November 14, 2026 12:24
@HaystackBot HaystackBot added the cla-pending PR is in draft until the contributor signs the CLA label Nov 14, 2026
@HaystackBot
HaystackBot marked this pull request as draft November 14, 2026 12:24
@HaystackBot
HaystackBot marked this pull request as ready for review November 14, 2026 12:27
@HaystackBot HaystackBot removed the cla-pending PR is in draft until the contributor signs the CLA label Nov 14, 2026
@HaystackBot

Copy link
Copy Markdown
Contributor

Thanks for signing the CLA, @AkilLabs! 🎉 This PR is now ready for review again and the reviewer has been re-assigned.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants