From 58d12160be65df25fec90a21788b1798c85ca0a5 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 7 Sep 2023 20:24:14 +0200 Subject: [PATCH] Add explanatory comment --- .../sdk/metrics/_internal/_view_instrument_match.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/_view_instrument_match.py b/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/_view_instrument_match.py index ece723dfed..110f963a48 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/_view_instrument_match.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/_view_instrument_match.py @@ -136,4 +136,8 @@ def collect( ) if data_point is not None: data_points.append(data_point) + + # Returning here None instead of an empty list because the caller + # does not consume a sequence and to be consistent with the rest of + # collect methods that also return None. return data_points or None