DocumentJoiner positional weights follow Variadic arrival order, not connect() order
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
- #12647 @coder058 による — マージされずにクローズ
評価
この issue はまだ評価されていません。
説明
Describe the bug
DocumentJoiner weights=[w0, w1, …] are zipped positionally onto the Variadic documents list. That list order is not Pipeline.connect() order:
- sync
run: independent senders run in alphabetical component-name order, so weights bind to alphabetical arrival run_async: completion/arrival order (nondeterministic)
Users reasonably assume connect(sparse); connect(dense) + weights=[sparse_w, dense_w] maps weights to those senders. The same graph + weights can therefore produce different hybrid scores.
Related: if a predecessor never runs (e.g. a ConditionalRouter branch is skipped), len(document_lists) < len(weights) and zip(..., strict=True) raises ValueError / PipelineRuntimeError.
To Reproduce
from haystack import Pipeline, Document, component
from haystack.components.joiners import DocumentJoiner
@component
class EmitDocs:
def __init__(self, docs):
self.docs = docs
@component.output_types(documents=list[Document])
def run(self):
return {documents: self.docs}
p = Pipeline()
# alphabetical: dense < sparse — opposite of connect order below
p.add_component(dense, EmitDocs([Document(content=shared, score=10.0)]))
p.add_component(sparse, EmitDocs([Document(content=shared, score=1.0)]))
p.add_component(joiner, DocumentJoiner(join_mode=merge, weights=[0.9, 0.1], sort_by_score=False))
p.connect(sparse, joiner) # intended weight 0.9
p.connect(dense, joiner) # intended weight 0.1
score = p.run({})[joiner][documents][0].score
print(score)
# actual today: 9.1 (dense*0.9 + sparse*0.1)
# expected if connect order: 1.9 (sparse*0.9 + dense*0.1)
Skipped-branch crash:
from haystack.components.routers import ConditionalRouter
# router -> branch_a / branch_b -> DocumentJoiner(weights=[0.5, 0.5])
# run with only branch_a selected -> zip length mismatch
Expected behavior
Weights follow connect() / InputSocket.senders order. Missing senders pad as empty lists so weighted merge/RRF does not crash.
Related
- Closed discussion of alphabetical auto-variadic ordering: #10979 (auto-promoted list sockets; this issue is about explicit
Variadic+ DocumentJoiner weights)
👋 Hello there! This issue will be handled internally and isn't open for external contributions. If you'd like to contribute, please take a look at issues labeled contributions welcome or good first issue. We'd really appreciate it!
- 主要言語
- Python
- スター
- 27.2k
- フォーク
- 3.5k
- 平均マージ
- 1日 18時間
- マージ済み PR(30日)
- 254
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
deepset-ai/haystack のほかの issue
-
feat: `ByteStream.from_file_path` should keep the file path in `meta`対応中かも @pinjun99 が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
deepset-ai/haystack#14081 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
BlockingConfirmationStrategy ignores an empty argument replacement対応中かも @sjrl が 6 日前に担当しました。 オープンP1
難易度 1/5 1〜3時間 初心者へのやさしさ 82/100
deepset-ai/haystack#13863 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
CSVToDocument row mode fails on CR-separated CSV input対応中かも @julian-risch が 66 日前に担当しました。 オープンP3
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
deepset-ai/haystack#13022 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
CSVToDocument row mode drops a real extra_columns field on ragged rows再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンhandled internally P3
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
deepset-ai/haystack#12994 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
CSVDocumentCleaner deletes a row that says N/A, and both CSV components empty those cells対応中かも @michaelkillgta が 72 日前に担当しました。 オープンP3
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
deepset-ai/haystack#12784 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
deepset-ai/haystack の issue をすべて見る
似ている issue
-
Test: to_hijri() accepts datetime.datetime and uses only the date part対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンgood first issue
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
omarelshamy25x/shamy-hijri#63 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
polish
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
521xueweihan/HelloGitHub#4729 ·
-
[Bug]: Score parser reads parts of scientific notation as valid scores対応中かも @AshutoshSingh840 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
UKGovernmentBEIS/control-arena#992 ·
メンテナーはふだん 3 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
mvalentsev/awesome-free-ai-coding#70 ·
メンテナーはふだん 1 日以内に返信