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

Aperta
#41,600 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@rokadepiyush49-rgb ci sta già lavorando.

Dal 23/11/2026.

  • #41598 di @rokadepiyush49-rgb — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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
Lingua principale
Java
Stelle
8.7k
Fork
4.8k
Merge medio
3g 16h
PR unite (30g)
445

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/beam

Tutte le issue di apache/beam

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.