This is an automated email from the ASF dual-hosted git repository.
cvandermerwe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new 335e96b5073 [yaml] : Add final expand pipeline ut (#37260)
335e96b5073 is described below
commit 335e96b50739a26abe6d16195e57f7d27aa7e231
Author: Derrick Williams <[email protected]>
AuthorDate: Mon Jan 12 09:11:58 2026 -0500
[yaml] : Add final expand pipeline ut (#37260)
* Add final exand pipeline ut
* add gemini recommendation
---
.../apache_beam/yaml/yaml_transform_unit_test.py | 29 ++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/sdks/python/apache_beam/yaml/yaml_transform_unit_test.py
b/sdks/python/apache_beam/yaml/yaml_transform_unit_test.py
index 59b1619b651..f8369773259 100644
--- a/sdks/python/apache_beam/yaml/yaml_transform_unit_test.py
+++ b/sdks/python/apache_beam/yaml/yaml_transform_unit_test.py
@@ -1099,6 +1099,35 @@ class ExpandPipelineTest(unittest.TestCase):
with self.assertRaises(KeyError):
expand_pipeline(p, spec, validate_schema=None)
+ @unittest.skipIf(jsonschema is None, "Yaml dependencies not installed")
+ def test_expand_pipeline_with_valid_schema(self):
+ spec = '''
+ pipeline:
+ type: chain
+ transforms:
+ - type: Create
+ config:
+ elements: [1,2,3]
+ - type: LogForTesting
+ '''
+ with new_pipeline() as p:
+ expand_pipeline(p, spec, validate_schema='generic')
+
+ @unittest.skipIf(jsonschema is None, "Yaml dependencies not installed")
+ def test_expand_pipeline_with_invalid_schema(self):
+ spec = '''
+ pipeline:
+ type: chain
+ transforms:
+ - name: Create
+ config:
+ elements: [1,2,3]
+ - type: LogForTesting
+ '''
+ with new_pipeline() as p:
+ with self.assertRaises(jsonschema.ValidationError):
+ expand_pipeline(p, spec, validate_schema='generic')
+
if __name__ == '__main__':
logging.getLogger().setLevel(logging.INFO)