Skip to content

Instantly share code, notes, and snippets.

@swegner
Created September 26, 2016 20:22
Show Gist options
  • Save swegner/6df00df1423b48206c4ab5a7e917218a to your computer and use it in GitHub Desktop.
Save swegner/6df00df1423b48206c4ab5a7e917218a to your computer and use it in GitHub Desktop.
from __future__ import absolute_import
import logging
import apache_beam as beam
from apache_beam.utils.options import PipelineOptions
from apache_beam.utils.options import SetupOptions
from apache_beam.utils.options import StandardOptions
def run():
options = PipelineOptions()
options.view_as(SetupOptions).requirements_file = 'requirements.txt'
options.view_as(StandardOptions).runner = 'DataflowPipelineRunner'
p = beam.Pipeline(options=options)
p | beam.Create(['foo', 'bar'])
p.run()
if __name__ == '__main__':
logging.getLogger().setLevel(logging.INFO)
run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment