This is an automated email from the ASF dual-hosted git repository. jrmccluskey pushed a commit to branch release-2.58.0 in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/release-2.58.0 by this push: new cdc19d07da9 [yaml] Fix yaml provider schema validation and merging (#31974) (#31984) cdc19d07da9 is described below commit cdc19d07da928f8bf55bffa672a3a19e7941cf73 Author: Jack McCluskey <34928439+jrmcclus...@users.noreply.github.com> AuthorDate: Thu Jul 25 11:11:45 2024 -0400 [yaml] Fix yaml provider schema validation and merging (#31974) (#31984) Signed-off-by: Jeffrey Kinard <j...@thekinards.com> Co-authored-by: Jeff Kinard <j...@thekinards.com> --- sdks/python/apache_beam/yaml/pipeline.schema.yaml | 6 ++++-- sdks/python/apache_beam/yaml/yaml_transform.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sdks/python/apache_beam/yaml/pipeline.schema.yaml b/sdks/python/apache_beam/yaml/pipeline.schema.yaml index f68a7306d94..c3937e61131 100644 --- a/sdks/python/apache_beam/yaml/pipeline.schema.yaml +++ b/sdks/python/apache_beam/yaml/pipeline.schema.yaml @@ -168,8 +168,10 @@ $defs: providerOrProviderInclude: if: - properties: - include {} + allOf: [ + { properties: { include: { type: string }}}, + { required: [ "include" ] } + ] then: $ref: '#/$defs/providerInclude' else: diff --git a/sdks/python/apache_beam/yaml/yaml_transform.py b/sdks/python/apache_beam/yaml/yaml_transform.py index c1c509ebde2..ffef9bbcd8f 100644 --- a/sdks/python/apache_beam/yaml/yaml_transform.py +++ b/sdks/python/apache_beam/yaml/yaml_transform.py @@ -1064,5 +1064,5 @@ def expand_pipeline( return YamlTransform( pipeline_as_composite(pipeline_spec['pipeline']), yaml_provider.merge_providers( - pipeline_spec.get('providers', []), providers or - {})).expand(beam.pvalue.PBegin(pipeline)) + yaml_provider.parse_providers(pipeline_spec.get('providers', [])), + providers or {})).expand(beam.pvalue.PBegin(pipeline))