2017-05-09 5 views
1

) これは私の最初の質問です。 私は非常に単純なパイプラインを作成したいと思っており、すでに最初に立ち往生しています。ここに私のコードが来る:beam dataflow pythonの名前 'PipelineOptions'が定義されていません

import apache_beam as beam 
options = PipelineOptions() 
google_cloud_options = options.view_as(GoogleCloudOptions) 
google_cloud_options.project = 'myproject' 
google_cloud_options.job_name = 'mypipe' 
google_cloud_options.staging_location = 'gs://mybucket/staging' 
google_cloud_options.temp_location = 'gs://mybucket/temp' 
options.view_as(StandardOptions).runner = 'DataflowRunner' 

は、エラーが発生します。 NameError:名 'PipelineOptionsは' あなたの助け

Thxを定義されていません。

答えて

0

例が機能するためにあなたはいくつかの追加輸入を追加する必要があります。

from apache_beam.io import ReadFromText 
from apache_beam.io import WriteToText 
from apache_beam.metrics import Metrics 
from apache_beam.utils.pipeline_options import PipelineOptions 
from apache_beam.utils.pipeline_options import SetupOptions 
from apache_beam.utils.pipeline_options import GoogleCloudOptions 
from apache_beam.utils.pipeline_options import StandardOptions 
関連する問題