[Bug]: AfterProcessingTime with a fractional delay fails to translate, and from_runner_api drops the fraction
Les mainteneurs répondent en général sous 2 jours
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 25/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- python
- Domaine
- stream-processing
Piste de recherche
Read apache_beam/transforms/trigger.py around after-processing-time support, where the issue names four defects. Compare the other triggers' to_runner_api, from_runner_api, __repr__ and __eq__/__hash__ implementations with it. Extend RunnerApiTest.test_trigger_encoding with a 1500 ms proto case and a fractional-delay round trip; done means fractional delays translate on the default runner and equal delays compare equal. Note a linked PR (#41575) already proposes this fix, so check it before starting.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
What happened?
AfterProcessingTime takes its delay in seconds, but only whole seconds work. A fractional delay can't be translated, so a pipeline that uses one fails on the default runner:
import apache_beam as beam
from apache_beam.transforms import trigger, window
with beam.Pipeline() as p:
(p | beam.Create([('k', 1), ('k', 2)])
| beam.WindowInto(window.GlobalWindows(),
trigger=trigger.Repeatedly(trigger.AfterProcessingTime(0.5)),
accumulation_mode=trigger.AccumulationMode.DISCARDING)
| beam.GroupByKey())
# RuntimeError: Unable to translate WindowInto(WindowIntoFn)
On 2.78.0, in apache_beam/transforms/trigger.py:
to_runner_apisetsdelay_millis=self.delay * 1000, which is a float for a fractional delay, so the proto rejects it (TypeError: 'float' object cannot be interpreted as an integer).from_runner_apidividesdelay_milliswith// 1000. A trigger with a 1500 ms delay from the proto becomesAfterProcessingTime(1), and one with 500 ms becomesAfterProcessingTime(0).__repr__formats the delay with%d, soAfterProcessingTime(0.5)shows asAfterProcessingTime(delay=0).- Unlike the other triggers,
AfterProcessingTimehas no__eq__or__hash__, soAfterProcessingTime(10) != AfterProcessingTime(10). For example,Flattenof two inputs windowed with the sameWindowInto(..., trigger=AfterProcessingTime(10))logs "All input pcollections must have the same window". This is also whyRunnerApiTest.test_trigger_encodingdoesn't coverAfterProcessingTime.
The fix would be to round the delay to whole milliseconds in to_runner_api, keep the fraction in from_runner_api, use %s in __repr__, and add __eq__ and __hash__ on the delay. I have a PR with tests ready.
Issue Priority
Priority: 2 (default / most bugs should be filed as P2)
Issue Components
- Component: Python SDK
- Langage dominant
- Java
- Étoiles
- 8.7k
- Forks
- 4.8k
- Merge moyen
- 3 j 16 h
- PR mergées (30 j)
- 445
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de apache/beam
-
awaiting triage java new feature P2
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 2 jours
-
[Bug]: [Python] BigTableEnrichmentHandler coerces None lookup keys to literal b'None' and formats blank key name on KeyErrorPeut-être pris @shikhabhadoria l’a pris il y a 6 jours. Ouverteio P2 python
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
apache/beam#41346 · 4 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 2 jours
-
Release notes links wrongPeut-être pris @schizophrenicmaniac l’a pris il y a 20 jours. Ouvertebug P3
Difficulté 1/5 Moins d'une heure Accessibilité débutants 67/100
apache/beam#41197 · 3 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
apache/beam#39624 · 2 réactions ·
Les mainteneurs répondent en général sous 2 jours
-
[Bug]: PubsubIO used in batch incorrect batch cutoff sizePeut-être pris @1fanwang l’a pris il y a 98 jours. Ouvertebug io P3 pinned pubsub
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
apache/beam#28011 · 4 commentaires ·
Les mainteneurs répondent en général sous 2 jours
Toutes les issues de apache/beam
Issues similaires
-
effort/l priority/p1 risk/high triage/core
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
iflytek/skillhub#1188 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
testng-team/testng#3675 ·
Les mainteneurs répondent en général sous 1 jour
-
Improve readability of build file paths in the Run/Debug configuration "Build file" dropdownOuvertedesign
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
OpenLiberty/liberty-tools-intellij#1869 ·
Les mainteneurs répondent en général sous 1 jour
-
`ovsx verify` fails for a version older than the 100 newest of an extensionPeut-être pris @trivikr l’a pris aujourd’hui. Ouvertecli
Difficulté 2/5 1-3 heures Accessibilité débutants 81/100
eclipse-openvsx/openvsx#2482 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 83/100
Les mainteneurs répondent en général sous 1 jour