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

オープン
#41,709 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@leninworld がすでに取り組んでいます。

2026年11月27日 から。

  • #41710 @leninworld による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
data

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
Java
スター
8.7k
フォーク
4.8k
平均マージ
3日 16時間
マージ済み PR(30日)
445

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/beam のほかの issue

apache/beam の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。