chamikaramj commented on a change in pull request #15484:
URL: https://github.com/apache/beam/pull/15484#discussion_r712173592
##########
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:
Done.
##########
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:
Done.
--
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]