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

Đang mở
#41,600 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@rokadepiyush49-rgb đang làm issue này rồi.

Từ ngày 23/11/2026.

  • #41598 của @rokadepiyush49-rgb — đang mở

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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
Ngôn ngữ chính
Java
Star
8.7k
Fork
4.8k
Merge trung bình
3 ngày 16 giờ
Pull request đã merge (30 ngày)
445

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/beam

Tất cả issue của apache/beam

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.