[Bug]: [Python] DirectRunner Prism fallback to BundleBasedDirectRunner fails with NotImplementedError on batched DoFns (WriteToParquet)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- backend, data-engineering
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Java
- Stelle
- 8.7k
- Fork
- 4.8k
- Merge medio
- 2g 12h
- PR unite (30g)
- 371
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/beam
-
Release notes links wrongApertaawaiting triage bug P3
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 67/100
apache/beam#41197 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: [Python] WriteToJson silently rounds floats to 10 decimal placesForse già presa @Abhi2939 l’ha presa 2 giorni fa. Apertaio P2 python yaml
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
apache/beam#41102 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
apache/beam#39624 · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: PubsubIO used in batch incorrect batch cutoff sizeForse già presa @1fanwang l’ha presa 79 giorni fa. Apertabug io P3 pinned pubsub
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/beam#28011 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
build P3 sub-task
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
spAnser/reacharound#38 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 89/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Type: Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
MovingBlocks/Terasology#5415 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100