Skip to content

Commit

Permalink
Make advisory attribute private
Browse files Browse the repository at this point in the history
  • Loading branch information
xrmx committed Jan 15, 2025
1 parent dd5adcf commit 3284c00
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1277,8 +1277,8 @@ def _create_aggregation(

if isinstance(instrument, Histogram):
boundaries: Optional[Sequence[float]] = (
instrument.advisory.get("explicit_bucket_boundaries")
if instrument.advisory is not None
instrument._advisory.get("explicit_bucket_boundaries")
if instrument._advisory is not None
else None
)
return _ExplicitBucketHistogramAggregation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def __init__(
instrumentation_scope=instrumentation_scope,
measurement_consumer=measurement_consumer,
)
self.advisory = advisory
self._advisory = advisory

def __new__(cls, *args, **kwargs):
if cls is Histogram:
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-sdk/tests/metrics/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ def test_create_histogram_with_advisory(self):
self.assertIsInstance(histogram, Histogram)
self.assertEqual(histogram.name, "name")
self.assertEqual(
histogram.advisory, {"explicit_bucket_boundaries": [0, 1, 2]}
histogram._advisory, {"explicit_bucket_boundaries": [0, 1, 2]}
)

def test_create_histogram_advisory_validation(self):
Expand Down

0 comments on commit 3284c00

Please sign in to comment.