You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/08/13 19:42:07 UTC

[GitHub] [beam] y1chi commented on a change in pull request #12570: fix logic issue in metric name namespace filtering

y1chi commented on a change in pull request #12570:
URL: https://github.com/apache/beam/pull/12570#discussion_r470203515



##########
File path: sdks/python/apache_beam/metrics/metric.py
##########
@@ -130,10 +130,16 @@ def _matches_name(filter, metric_key):
     if not filter.names and not filter.namespaces:
       return True
 
-    if ((filter.namespaces and metric_key.metric.namespace in filter.namespaces)
-        or (filter.names and metric_key.metric.name in filter.names)):
-      return True
-    return False
+    if filter.names and filter.namespaces:

Review comment:
       I think the condition is probably better expressed as
   not ((filter.namespaces and metric_key.metric.namespace not in filter.namespaces) or (filter.names and metric_key.metric.name not in filter.names))
   




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org