leninworld opened a new issue, #41709:
URL: https://github.com/apache/beam/issues/41709

   ### 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
   
   ```python
   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
   
   - [x] Component: Python SDK
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to