Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: How to run YAML pipeline from Python SDK rather than from command line #32416

Closed
2 of 17 tasks
diptenduLF opened this issue Sep 10, 2024 · 1 comment
Closed
2 of 17 tasks

Comments

@diptenduLF
Copy link

What happened?

The examples run YAML pipeline from the command line:

python -m apache_beam.yaml.main --pipeline_spec_file=pipeline-01.yaml
However, I want to run the pipeline file from within a Python script like:

with beam.Pipeline('DirectRunner') as p:
......

How can this be done?

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
  • 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
@liferoad
Copy link
Collaborator

https://github.com/GoogleCloudPlatform/DataflowTemplates/blob/main/python/src/main/python/yaml-template/main.py

from apache_beam.yaml import main

# parse your argv then do this

main.run(argv=your_argv)

@github-actions github-actions bot added this to the 2.60.0 Release milestone Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants