You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "liferoad (via GitHub)" <gi...@apache.org> on 2025/04/21 13:57:51 UTC
[I] [Bug]: Improve the validation error when both chain and input are given for Beam YAML [beam]
liferoad opened a new issue, #34690:
URL: https://github.com/apache/beam/issues/34690
### What happened?
Test YAML:
```
pipeline:
type: chain
transforms:
- type: Create
config:
elements: [1, 2, 3]
- type: LogForTesting
input: Create
```
When running this with `python -m apache_beam.yaml.main --yaml_pipeline_file=test_chain.yaml`, got this error:
```
INFO:root:Missing pipeline option (runner). Executing pipeline using the default runner: DirectRunner.
Building pipeline...
Traceback (most recent call last):
File "/Users/xqhu/miniconda3/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/Users/xqhu/miniconda3/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/Users/xqhu/PlayGround/yaml/venv1/lib/python3.10/site-packages/apache_beam/yaml/main.py", line 183, in <module>
run()
File "/Users/xqhu/PlayGround/yaml/venv1/lib/python3.10/site-packages/apache_beam/yaml/main.py", line 129, in run
constructor(p)
File "/Users/xqhu/PlayGround/yaml/venv1/lib/python3.10/site-packages/apache_beam/yaml/main.py", line 170, in constructor
yaml_transform.expand_pipeline(
File "/Users/xqhu/PlayGround/yaml/venv1/lib/python3.10/site-packages/apache_beam/yaml/yaml_transform.py", line 1114, in expand_pipeline
validate_against_schema(pipeline_spec, validate_schema)
File "/Users/xqhu/PlayGround/yaml/venv1/lib/python3.10/site-packages/apache_beam/yaml/yaml_transform.py", line 88, in validate_against_schema
raise exn
File "/Users/xqhu/PlayGround/yaml/venv1/lib/python3.10/site-packages/apache_beam/yaml/yaml_transform.py", line 85, in validate_against_schema
jsonschema.validate(pipeline, pipeline_schema(strictness))
File "/Users/xqhu/PlayGround/yaml/venv1/lib/python3.10/site-packages/jsonschema/validators.py", line 1332, in validate
raise error
jsonschema.exceptions.ValidationError: 'Create' should not be valid under {} around line 8
Failed validating 'not' in schema['properties']['pipeline']['allOf'][2]['then']['properties']['transforms']['items']['properties']['input']:
{'not': {}}
On instance['pipeline']['transforms'][1]['input']:
'Create'
```
What should happen?
A better validation error that indicates both chain and input cannot be given.
### Issue Priority
Priority: 2 (default / most bugs should be filed as P2)
### Issue Components
- [ ] Component: Python SDK
- [ ] Component: Java SDK
- [ ] Component: Go SDK
- [ ] Component: Typescript SDK
- [ ] Component: IO connector
- [x] Component: Beam YAML
- [ ] Component: Beam examples
- [ ] Component: Beam playground
- [ ] Component: Beam katas
- [ ] Component: Website
- [ ] Component: Infrastructure
- [ ] Component: Spark Runner
- [ ] Component: Flink Runner
- [ ] Component: Samza Runner
- [ ] Component: Twister2 Runner
- [ ] Component: Hazelcast Jet Runner
- [ ] Component: Google Cloud Dataflow Runner
--
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: github-unsubscribe@beam.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug]: Improve the validation error when both chain and input are given for Beam YAML [beam]
Posted by "TanuSharma2511 (via GitHub)" <gi...@apache.org>.
TanuSharma2511 commented on issue #34690:
URL: https://github.com/apache/beam/issues/34690#issuecomment-2822932950
Test for this scenario should fail with [error](https://github.com/apache/beam/blob/master/sdks/python/apache_beam/yaml/yaml_transform.py#L593) because in unit tests, we are directly calling YamlTransform() which eventually will call [preprocess](https://github.com/apache/beam/blob/master/sdks/python/apache_beam/yaml/yaml_transform.py#L634C5-L634C21) and error will occur.
But usually, run() is used to trigger the pipeline, so pipeline failed before reaching YamlTransform() while validating against the [schema](https://github.com/apache/beam/blob/master/sdks/python/apache_beam/yaml/pipeline.schema.yaml#L18). So, I think we need to test current changes using run() or expand_pipeline().
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug]: Improve the validation error when both chain and input are given for Beam YAML [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #34690: [Bug]: Improve the validation error when both chain and input are given for Beam YAML
URL: https://github.com/apache/beam/issues/34690
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug]: Improve the validation error when both chain and input are given for Beam YAML [beam]
Posted by "shubham-j-sde (via GitHub)" <gi...@apache.org>.
shubham-j-sde commented on issue #34690:
URL: https://github.com/apache/beam/issues/34690#issuecomment-2823191079
thank u for analysis Tanu, let me do some further research before adding the test.
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug]: Improve the validation error when both chain and input are given for Beam YAML [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #34690:
URL: https://github.com/apache/beam/issues/34690#issuecomment-3314949648
This issue has been marked as stale due to 150 days of inactivity. It will be closed in 30 days if no further activity occurs. If you think that’s incorrect or this issue still needs to be addressed, please simply write any comment. If closed, you can reopen the issue at any time. Thank you for your contributions.
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug]: Improve the validation error when both chain and input are given for Beam YAML [beam]
Posted by "shubham-j-sde (via GitHub)" <gi...@apache.org>.
shubham-j-sde commented on issue #34690:
URL: https://github.com/apache/beam/issues/34690#issuecomment-2818496827
I'll take this
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug]: Improve the validation error when both chain and input are given for Beam YAML [beam]
Posted by "shubham-j-sde (via GitHub)" <gi...@apache.org>.
shubham-j-sde commented on issue #34690:
URL: https://github.com/apache/beam/issues/34690#issuecomment-2818497949
.take-issue
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug]: Improve the validation error when both chain and input are given for Beam YAML [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #34690:
URL: https://github.com/apache/beam/issues/34690#issuecomment-3421917858
This issue has been closed due to lack of activity. If you think that is incorrect, you can reopen the issue at any time.
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org