[Bug]: [Python] DirectRunner Prism fallback to BundleBasedDirectRunner fails with NotImplementedError on batched DoFns (WriteToParquet)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- backend, data-engineering
Línea de trabajo
Start in sdks/python/apache_beam/runners/direct/direct_runner.py, especially the SwitchingDirectRunner fallback around lines 141–146 and 204–230; compare its behavior with FnApiRunner for process_batch transforms. Reproduce with the provided WriteToParquet pipeline, then check relevant direct runner tests. Done means the fallback runs batched DoFns successfully without breaking the existing runner paths.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happened?
When running a Python or Beam YAML pipeline with the default DirectRunner (SwitchingDirectRunner), if PrismRunner is bypassed (for example when the pipeline contains an external cross-language transform per direct_runner.py:141) or cannot start (offline environment / restricted container where the Prism binary cannot be downloaded or executed), SwitchingDirectRunner falls back to BundleBasedDirectRunner.
If the pipeline includes WriteToParquet (or any transform using DoFn.process_batch), execution then fails with NotImplementedError, even though the in-process FnApiRunner executes the exact same pipeline cleanly.
Minimal reproducer (forcing the non-Prism fallback path):
import tempfile, apache_beam as beam, pyarrow as pa
schema = pa.schema([('id', pa.int64()), ('name', pa.string())])
with tempfile.TemporaryDirectory() as d:
with beam.Pipeline(runner='BundleBasedDirectRunner') as p:
(p
| beam.Create([{'id': 1, 'name': 'Ada'}])
| beam.io.WriteToParquet(f'{d}/out', schema=schema))
Cause
In sdks/python/apache_beam/runners/direct/direct_runner.py (lines 141–146 and 204–230), SwitchingDirectRunner unconditionally falls back to BundleBasedDirectRunner(), which does not implement process_batch for batched PyArrow DoFns (FnApiRunner does). Checking for process_batch transforms (or routing batch pipelines without TestStream/unbounded state to FnApiRunner when Prism is unavailable) avoids the failure.
Issue Priority
Priority: 2 (default / most bugs should be filed as P2)
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: Prism Runner
- Component: Hazelcast Jet Runner
- Component: Google Cloud Dataflow Runner
- Lenguaje dominante
- Java
- Estrellas
- 8.7k
- Forks
- 4.8k
- Merge medio
- 2 d 12 h
- PR fusionados (30 d)
- 371
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/beam
-
Release notes links wrongAbiertoawaiting triage bug P3
Dificultad 1/5 Menos de una hora Aptitud para principiantes 67/100
apache/beam#41197 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
[Bug]: [Python] WriteToJson silently rounds floats to 10 decimal placesPosiblemente ocupada @Abhi2939 la tomó hace 2 días. Abiertoio P2 python yaml
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
apache/beam#41102 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
apache/beam#39624 · 2 reacciones ·
Los mantenedores suelen responder en 1 día
-
[Bug]: PubsubIO used in batch incorrect batch cutoff sizePosiblemente ocupada @1fanwang la tomó hace 79 días. Abiertobug io P3 pinned pubsub
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/beam#28011 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
build P3 sub-task
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
Todos los issues de apache/beam
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
spAnser/reacharound#38 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 89/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Type: Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
MovingBlocks/Terasology#5415 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100