diff --git a/newrelic/common/metric_utils.py b/newrelic/common/metric_utils.py index 654f8051c4..ebffe83328 100644 --- a/newrelic/common/metric_utils.py +++ b/newrelic/common/metric_utils.py @@ -27,11 +27,9 @@ def create_metric_identity(name, tags=None): # Apply attribute system sanitization. # process_user_attribute returns (None, None) for results that fail sanitization. - # The filter removes these results fromt he iterable before creating the frozenset. + # The filter removes these results from the iterable before creating the frozenset. tags = frozenset(filter(lambda args: args[0] is not None, map(lambda args: process_user_attribute(*args), tags))) - # Set empty iterables after filtering to None - if not tags and tags is not None: - tags = None + tags = tags or None # Set empty iterables after filtering to None return (name, tags)