[
https://issues.apache.org/jira/browse/BEAM-12769?focusedWorklogId=652511&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-652511
]
ASF GitHub Bot logged work on BEAM-12769:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 18/Sep/21 00:36
Start Date: 18/Sep/21 00:36
Worklog Time Spent: 10m
Work Description: ihji commented on a change in pull request #15484:
URL: https://github.com/apache/beam/pull/15484#discussion_r711410111
##########
File path: sdks/python/apache_beam/transforms/external_test.py
##########
@@ -406,6 +410,88 @@ class DataclassTransform(beam.ExternalTransform):
return get_payload(DataclassTransform(**values))
+class JavaClassLookupPayloadBuilderTest(unittest.TestCase):
Review comment:
Do we also need a test for setting `with_constructor_method` twice? or
setting `with_constructor_method` after `with_constructor`?
##########
File path: sdks/python/apache_beam/transforms/external_test.py
##########
@@ -406,6 +410,88 @@ class DataclassTransform(beam.ExternalTransform):
return get_payload(DataclassTransform(**values))
+class JavaClassLookupPayloadBuilderTest(unittest.TestCase):
+ def _verify_row(self, schema, row_payload, expected_values):
+ row = RowCoder(schema).decode(row_payload)
+
+ for attr_name, expected_value in expected_values.items():
+ self.assertTrue(hasattr(row, attr_name))
+ value = getattr(row, attr_name)
+ self.assertEqual(expected_value, value)
+
+ def test_build_payload_with_constructor(self):
+ payload_builder = JavaClassLookupPayloadBuilder('dummy_class_name')
+
+ payload_builder.with_constructor('abc', 123, str_field='def',
int_field=456)
+ payload_bytes = payload_builder.payload()
+ payload_from_bytes = proto_utils.parse_Bytes(
+ payload_bytes, JavaClassLookupPayload)
+ self.assertTrue(isinstance(payload_from_bytes, JavaClassLookupPayload))
Review comment:
Also check `constructor_method` field is empty?
--
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 652511)
Time Spent: 20h 20m (was: 20h 10m)
> Adds support for expanding a Java cross-language transform using the class
> name and builder methods
> ---------------------------------------------------------------------------------------------------
>
> Key: BEAM-12769
> URL: https://issues.apache.org/jira/browse/BEAM-12769
> Project: Beam
> Issue Type: Improvement
> Components: cross-language, sdk-java-core
> Reporter: Chamikara Madhusanka Jayalath
> Assignee: Chamikara Madhusanka Jayalath
> Priority: P2
> Time Spent: 20h 20m
> Remaining Estimate: 0h
>
> Please see here for the design:
> https://docs.google.com/document/d/1ECXSWicE31K-vSxdb4qL6UcmovOAWvE-ZHFT3NTM654/edit?usp=sharing
--
This message was sent by Atlassian Jira
(v8.3.4#803005)