reuvenlax commented on code in PR #40297:
URL: https://github.com/apache/beam/pull/40297#discussion_r4260888488


##########
sdks/python/apache_beam/yaml/test_utils/datadog_test_utils.py:
##########
@@ -116,16 +116,14 @@ def temp_fake_datadog_server(expected_records=None):
       logging.error(
           "Error interacting with temporary fake Datadog server: %s", err)
       raise err
-    finally:
-      if expected_records is not None:
 
-        canonicalize = lambda rec: json.dumps(rec, sort_keys=True)
+  if expected_records is not None:
+    canonicalize = lambda rec: json.dumps(rec, sort_keys=True)
 
-        actual_strs = sorted([canonicalize(r) for r in received])
-        expected_strs = sorted([canonicalize(e) for e in expected_records])
+    actual_strs = sorted(set(canonicalize(r) for r in received))

Review Comment:
   not sure I understand. using a set to dedup records is pretty common in 
Python I believe.



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