[Bug]: [Python] HistogramResult.p95 raises AttributeError because Histogram has no p95()

Aperta
#41,709 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@leninworld ci sta già lavorando.

Dal 27/11/2026.

  • #41710 di @leninworld — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python
Ambito
data

Direzione di ricerca

The issue identifies sdks/python/apache_beam/metrics/cells.py and apache_beam.utils.histogram.Histogram. Read the percentile properties and the existing p50(), p90() and p99() methods, then run the relevant Python histogram and metrics tests. Done when HistogramResult.p95 returns the interpolated 95th percentile and the tests cover it; pull request #41710 is already open.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

P2 python
What happened?

HistogramResult.p95 in sdks/python/apache_beam/metrics/cells.py returns self.data.histogram.p95(), but apache_beam.utils.histogram.Histogram only defines p50(), p90() and p99(). Reading .p95 on a histogram metric result therefore raises AttributeError, while .p90 and .p99 work.

Reproduction
from apache_beam.metrics.cells import HistogramData, HistogramResult
from apache_beam.utils.histogram import Histogram, LinearBucket

histogram = Histogram(LinearBucket(0, 1, 100))
histogram.record(*range(100))
result = HistogramResult(HistogramData(histogram))
print(result.p90, result.p99)  # 90.0 99.0
print(result.p95)
# AttributeError: 'Histogram' object has no attribute 'p95'. Did you mean: 'p90'?

Seen on master (f168ee3f6def2e8cf325d40337c3796375366806), Python 3.12.

Expected

result.p95 returns the linearly interpolated 95th percentile, like p90/p99 (95.0 here).

Issue Priority

Priority: 2 (default / most bugs should be filed as P2)

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.