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

未关闭
#41,600 1 条评论 0 个 reaction 已指派 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 小时
30 天内合并 PR
445

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/beam 的其他 Issue

查看 apache/beam 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。