[Feature Request]: Attach RunInference model_identifier annotation only to the inference ParDo when with_exception_handling(threshold<1) is used

オープン
#40,715 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@Brijesh-Thakkar がすでに取り組んでいます。

2026年10月31日 から。

  • #40922 @Brijesh-Thakkar による — マージされずにクローズ

評価

難易度
4/5
見積もり時間
1〜2日
初心者へのやさしさ
48/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python

調査の方向性

Start with RunInference.expand() and _ExceptionHandlingWrapper._post_process_result in the Python SDK, then read the linked transform_annotations implementation and the discussion on PR #40671. Trace how _build_pardo creates the wrapped inference ParDo and the threshold transforms. Done means the model_identifier annotation is attached only to the inference ParDo when exception handling uses a threshold below 1.

索引モデルが issue の本文から書いたものです。

説明

P3 python
What would you like to happen?

RunInference.expand() scopes the model_identifier transform annotation to the BeamML_RunInference step via pipeline.transform_annotations(model_identifier=...) (see #40671). Because transform_annotations applies to every sub-transform applied inside the context, when with_exception_handling(threshold=<1.0) is used, the threshold-checking transforms that _ExceptionHandlingWrapper._post_process_result adds (CountTotal, CountBad, CombineGlobally, CheckThreshold, ...) also inherit the model_identifier annotation, even though they never run _RunInferenceDoFn:

https://github.com/apache/beam/blob/5b6aa703f0ab6a48d92cc63ea89226485cc265f9/sdks/python/apache_beam/transforms/core.py#L2414

This is harmless for Dataflow today (only ParDo steps consume the annotation and the threshold steps are tiny), but it is imprecise. We should refactor so the annotation is attached only to the inner inference ParDo, e.g.:

  • expose a hook on _ExceptionHandlingWrapper / ParDo.with_exception_handling to annotate only the wrapped ParDo built in _build_pardo, or
  • apply the annotation to run_inference_pardo directly (e.g. via PTransform.annotations() on a thin ParDo subclass) instead of using the pipeline-level transform_annotations context manager.

Follow-up from the discussion in https://github.com/apache/beam/pull/40671#discussion_r4342559127.

Issue Priority

Priority: 3 (nice-to-have improvement)

Issue Components
  • Component: Python SDK
  • Component: Java SDK
  • Component: Go SDK
  • Component: Typescript SDK
  • Component: IO connector
  • Component: Beam YAML
  • Component: Beam examples
  • Component: Beam playground
  • Component: Beam katas
  • Component: Website
  • Component: Infrastructure
  • Component: Spark Runner
  • Component: Flink Runner
  • Component: Samza Runner
  • Component: Twister2 Runner
  • Component: Hazelcast Jet Runner
  • Component: Google Cloud Dataflow Runner
主要言語
Java
スター
8.7k
フォーク
4.8k
平均マージ
3日 16時間
マージ済み PR(30日)
445

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/beam のほかの issue

apache/beam の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。