dmkozh commented on a change in pull request #14834:
URL: https://github.com/apache/beam/pull/14834#discussion_r634808329



##########
File path: sdks/python/apache_beam/transforms/create_test.py
##########
@@ -121,6 +123,43 @@ def test_create_source_progress(self):
 
     self.assertEqual(expected_split_points_report, split_points_report)
 
+  def test_create_uses_coder_for_pickling(self):
+    coders.registry.register_coder(_Unpicklable, _UnpicklableCoder)
+    create = Create([_Unpicklable(1), _Unpicklable(2), _Unpicklable(3)])
+    unpickled_create = pickler.loads(pickler.dumps(create))
+    self.assertEqual(
+        sorted(create.values, key=lambda v: v.value),
+        sorted(unpickled_create.values, key=lambda v: v.value))
+
+    with self.assertRaises(NotImplementedError):
+      create_unpicklable = Create([_Unpicklable(1), 2])

Review comment:
       Unfortunately there is no special 'UnionCoder' as of now, so this falls 
back to FastPrimitivesCoder. Added a comment.




-- 
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:
[email protected]


Reply via email to