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


##########
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:
   Ah, I see. AFAICT from inspection of DatadogEventWriter, this is an 
at-least-once sink, and I'm not sure if the Datadog HTTP publish API provides a 
way to do exactly-once publishing. 



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