[
https://issues.apache.org/jira/browse/BEAM-12284?focusedWorklogId=598903&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-598903
]
ASF GitHub Bot logged work on BEAM-12284:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 18/May/21 22:23
Start Date: 18/May/21 22:23
Worklog Time Spent: 10m
Work Description: udim commented on a change in pull request #14834:
URL: https://github.com/apache/beam/pull/14834#discussion_r634791008
##########
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:
Why is this unpicklable? I don't understand why _UnpicklableCoder isn't
used here as well. Is this using FastPrimitivesCoder instead on a
Union[_Unpicklable, int]?
In any case, please add a comment explaining the difference.
--
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 598903)
Time Spent: 1h (was: 50m)
> beam.Create should respect element coder during pickling
> --------------------------------------------------------
>
> Key: BEAM-12284
> URL: https://issues.apache.org/jira/browse/BEAM-12284
> Project: Beam
> Issue Type: Bug
> Components: sdk-py-core
> Reporter: Dmytro Kozhevin
> Assignee: Dmytro Kozhevin
> Priority: P2
> Time Spent: 1h
> Remaining Estimate: 0h
>
> beam.Create stores values to create as a field. If the values can't be
> pickled, then the transform itself can't be pickled and transferred for
> remote execution. Instead it should encode/decode elements using the element
> coders during pickling/unpickling.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)