[Bug]: [Python] Error and log messages print {placeholders} literally because of missing f-string prefixes

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

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

@rokadepiyush49-rgb がすでに取り組んでいます。

2026年11月23日 から。

  • #41598 @rokadepiyush49-rgb による — オープン

評価

この issue はまだ評価されていません。

説明

P3 python
What happened?

Four messages in the Python SDK are plain strings with {...} placeholders, so they print the placeholder instead of the value:

  1. transforms/core.py, _ContextParam.__init__: passing an already-constructed context manager to DoFn.BundleContextParam or DoFn.SetupContextParam raises TypeError: ... write {class_name}(tempfile.TemporaryDirectory, args=(...)) rather than {class_name}(tempfile.TemporaryDirectory(...)).
  2. transforms/core.py, ParDo.infer_batch_converters: for a DoFn whose get_input_batch_type() returns None, the error is TypeError: process_batch method on {self.fn!r} does not have an input type annoation.
  3. typehints/schemas.py, SchemaTranslation.atomic_value_to_runner_api: ValueError: Unrecognized atomic_type {atomic_type} when encoding value {value}.
  4. runners/worker/data_sampler.py, DataSampler.sampler_for_output: the warning reads Out-of-bounds access for transform "..." and output "{output_index}" OutputSampler. ....

To reproduce the first one:

import contextlib
import apache_beam as beam

beam.DoFn.BundleContextParam(contextlib.nullcontext())

The same kind of bug was fixed in yaml/ by #41165, and #41134 fixes more there.

Issue Priority

Priority: 3 (minor)

Issue Components
  • Component: Python SDK
主要言語
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 を短くまとめたダイジェスト。