Skip to content

feat: Add tests for auto joiner with auto variadic behavior#10949

Merged
sjrl merged 3 commits intomainfrom
auto-joiner-with-auto-variadic
Mar 30, 2026
Merged

feat: Add tests for auto joiner with auto variadic behavior#10949
sjrl merged 3 commits intomainfrom
auto-joiner-with-auto-variadic

Conversation

@sjrl
Copy link
Copy Markdown
Contributor

@sjrl sjrl commented Mar 27, 2026

Related Issues

Proposed Changes:

Adding support for auto joiner and auto conversion behavior. It actually already works so this PR just adds tests for the different scenarios.

How did you test it?

Added new unit tests.

Notes for the reviewer

Checklist

  • I have read the contributors guidelines and the code of conduct.
  • I have updated the related issue with new insights and changes.
  • I have added unit tests and updated the docstrings.
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I have documented my code.
  • I have added a release note file, following the contributors guidelines.
  • I have run pre-commit hooks and fixed any issue.

@sjrl sjrl requested a review from a team as a code owner March 27, 2026 10:37
@sjrl sjrl requested review from bogdankostic and removed request for a team March 27, 2026 10:37
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
haystack-docs Ignored Ignored Preview Mar 27, 2026 10:39am

Request Review

@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Mar 27, 2026

Pull Request Test Coverage Report for Build 23642363216

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 92.888%

Totals Coverage Status
Change from base Build 23641733247: 0.0%
Covered Lines: 15855
Relevant Lines: 17069

💛 - Coveralls

Copy link
Copy Markdown
Contributor

@bogdankostic bogdankostic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks good, but there is an issue regarding the output order. In my opinion users would expect the joined lists to retain the order in which the components were connected. This doesn't seem to be the case if the two input components to a receiver component produce different types.

(Also, not sure about the feat commit type and release note in the current state of the PR - technically this is just adding tests, but I also see that having the release note will increase visibility that this behavior is supported.)

p.connect("str_producer.text", "receiver.texts")
p.connect("list_producer.texts", "receiver.texts")
result = p.run({})
assert result["receiver"]["result"] == ["world", "!", "hello"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about the result order here. Since str_producer is connected before list_producer, I would intuitively expect the joined output to retain that connection order, so ["hello", "world", "!"].

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The result order is actually based on alphabetical order of the component names in this case which is why the order is slightly different. It's because we run ordered_component_names = sorted(self.graph.nodes.keys()) internally and calculate priorities of components based on this ordered list.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And in the case of AsyncPipeline actually these two components str_producer and list_producer would actually run in parallel so the order would be non-deterministic.

So basically in general we don't expect inputs to joiners to be deterministic.

p.connect("str_producer.text", "receiver.texts")
p.connect("chat_producer.message", "receiver.texts")
result = p.run({})
assert result["receiver"]["result"] == ["world", "hello"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I'd expect the output order to match the connection order as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as here #10949 (comment)

p.connect("str_producer.text", "receiver.messages")
p.connect("chat_producer.message", "receiver.messages")
result = p.run({})
assert [m.text for m in result["receiver"]["result"]] == ["world", "hello"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I'd expect the output order to match the connection order as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as here #10949 (comment)

@sjrl
Copy link
Copy Markdown
Contributor Author

sjrl commented Mar 30, 2026

Also, not sure about the feat commit type and release note in the current state of the PR - technically this is just adding tests, but I also see that having the release note will increase visibility that this behavior is supported.

Yeah I was going for increasing the visibility of this, but I agree it's just tests.

@sjrl sjrl requested a review from bogdankostic March 30, 2026 13:45
Copy link
Copy Markdown
Contributor

@bogdankostic bogdankostic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, I'll open an issue to better document the order.

@sjrl sjrl merged commit bfe5aec into main Mar 30, 2026
20 checks passed
@sjrl sjrl deleted the auto-joiner-with-auto-variadic branch March 30, 2026 14:15
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.

Combine simple conversions with auto joiner behavior

3 participants