liferoad commented on code in PR #36528:
URL: https://github.com/apache/beam/pull/36528#discussion_r2440010020
##########
sdks/python/apache_beam/transforms/external_test.py:
##########
@@ -247,9 +247,19 @@ def test_pipeline_generation_with_runner_overrides(self):
'in the pipeline')
self.assertEqual(1, len(list(pubsub_read_transform.outputs.values())))
- self.assertEqual(
- list(pubsub_read_transform.outputs.values()),
- list(external_transform.inputs.values()))
+ self.assertEqual(1, len(list(external_transform.inputs.values())))
Review Comment:
```
=================================== FAILURES
===================================
_____ ExternalTransformTest.test_pipeline_generation_with_runner_overrides
_____
[gw1] linux -- Python 3.13.3
/runner/_work/beam/beam/sdks/python/test-suites/tox/py313/build/srcs/sdks/python/target/.tox-py313-cloud/py313-cloud/bin/python
self = <apache_beam.transforms.external_test.ExternalTransformTest
testMethod=test_pipeline_generation_with_runner_overrides>
@unittest.skipIf(apiclient is None, 'GCP dependencies are not installed')
def test_pipeline_generation_with_runner_overrides(self):
pipeline_properties = [
'--job_name=test-job',
'--project=test-project',
'--temp_location=gs://beam/tmp',
'--no_auth',
'--dry_run=True',
'--sdk_location=container',
'--runner=DataflowRunner',
'--streaming',
'--region=us-central1'
]
with beam.Pipeline(options=PipelineOptions(pipeline_properties)) as p:
_ = (
p
| beam.io.ReadFromPubSub(
subscription=
'projects/dummy-project/subscriptions/dummy-subscription')
| beam.ExternalTransform(
'beam:transforms:xlang:test:prefix',
ImplicitSchemaPayloadBuilder({'data': '0'}),
expansion_service.ExpansionServiceServicer()))
pipeline_proto, _ = p.to_runner_api(return_context=True)
pubsub_read_transform = None
external_transform = None
proto_transforms = pipeline_proto.components.transforms
for id in proto_transforms:
if 'beam:transforms:xlang:test:prefix' in proto_transforms[
id].unique_name:
external_transform = proto_transforms[id]
if 'ReadFromPubSub' in proto_transforms[id].unique_name:
pubsub_read_transform = proto_transforms[id]
if not (pubsub_read_transform and external_transform):
raise ValueError(
'Could not find an external transform and the PubSub read transform '
'in the pipeline')
self.assertEqual(1, len(list(pubsub_read_transform.outputs.values())))
> self.assertEqual(
list(pubsub_read_transform.outputs.values()),
list(external_transform.inputs.values()))
E AssertionError: Lists differ: ['ref_PCollection_PCollection_2'] !=
['ref_PCollection_PCollection_1']
E
E First differing element 0:
E 'ref_PCollection_PCollection_2'
E 'ref_PCollection_PCollection_1'
E
E - ['ref_PCollection_PCollection_2']
E ? ^
E
E + ['ref_PCollection_PCollection_1']
E ? ^
apache_beam/transforms/external_test.py:250: AssertionError
```
--
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]