[
https://issues.apache.org/jira/browse/BEAM-11688?focusedWorklogId=542527&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-542527
]
ASF GitHub Bot logged work on BEAM-11688:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 27/Jan/21 00:30
Start Date: 27/Jan/21 00:30
Worklog Time Spent: 10m
Work Description: ibzib commented on a change in pull request #13812:
URL: https://github.com/apache/beam/pull/13812#discussion_r564931019
##########
File path: sdks/python/apache_beam/coders/coders_test_common.py
##########
@@ -63,6 +65,34 @@ class CodersTest(unittest.TestCase):
# These class methods ensure that we test each defined coder in both
# nested and unnested context.
+ # Common test values representing Python's built-in types.
+ values_deterministic: List[Any] = [
Review comment:
Nit: `values_deterministic` is kind of vague, `values` even more so. Can
we rename to `test_values*`?
##########
File path: sdks/python/apache_beam/coders/coders_test_common.py
##########
@@ -63,6 +65,34 @@ class CodersTest(unittest.TestCase):
# These class methods ensure that we test each defined coder in both
# nested and unnested context.
+ # Common test values representing Python's built-in types.
Review comment:
👍
##########
File path: sdks/python/apache_beam/coders/coder_impl.py
##########
@@ -336,18 +336,18 @@ def __init__(self, proto_message_type):
self.proto_message_type = proto_message_type
def encode(self, value):
- return value.SerializeToString()
+ return value.SerializePartialToString()
def decode(self, encoded):
proto_message = self.proto_message_type()
- proto_message.ParseFromString(encoded)
+ proto_message.ParseFromString(encoded) # This is in effect "ParsePartial".
Review comment:
`# This is in effect "ParsePartial".` -> Why is this the case?
##########
File path: sdks/python/apache_beam/coders/coders_test_common.py
##########
@@ -129,12 +159,20 @@ def test_custom_coder(self):
(-10, b'b'), (5, b'c'))
def test_pickle_coder(self):
- self.check_coder(coders.PickleCoder(), 'a', 1, 1.5, (1, 2, 3))
+ coder = coders.PickleCoder()
+ self.check_coder(coder, *self.values)
def test_deterministic_coder(self):
coder = coders.FastPrimitivesCoder()
deterministic_coder = coders.DeterministicFastPrimitivesCoder(coder,
'step')
- self.check_coder(deterministic_coder, 'a', 1, 1.5, (1, 2, 3))
+ self.check_coder(deterministic_coder, *self.values_deterministic)
+ for v in self.values_deterministic:
+ self.check_coder(coders.TupleCoder((deterministic_coder, )), (v, ))
Review comment:
What makes TupleCoder a special case here? What coverage does this check
provide that `self.check_coder(deterministic_coder, (1, 2, 3))` didn't?
----------------------------------------------------------------
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: 542527)
Time Spent: 1h 20m (was: 1h 10m)
> Python ProtoCoder: support partial messages
> -------------------------------------------
>
> Key: BEAM-11688
> URL: https://issues.apache.org/jira/browse/BEAM-11688
> Project: Beam
> Issue Type: Bug
> Components: sdk-py-core
> Reporter: Udi Meiri
> Assignee: Udi Meiri
> Priority: P2
> Time Spent: 1h 20m
> Remaining Estimate: 0h
>
> The current implementation requires fully initialized messages. Using
> SerializePartialToString will relax this requirement.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)