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

Abierto
#40,715 1 comentario 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 2 días

@Brijesh-Thakkar ya está trabajando en esto.

Desde el 31/10/2026.

  • #40922 de @Brijesh-Thakkar — cerrado sin fusionar

Evaluación

Dificultad
4/5
Tiempo estimado
1-2 días
Aptitud para principiantes
48/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
Java
Estrellas
8.7k
Forks
4.8k
Merge medio
3 d 16 h
PR fusionados (30 d)
445

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de apache/beam

Todos los issues de apache/beam

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.