第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

將'add_value_provider_argument'與apache beam io函數(shù)一起

將'add_value_provider_argument'與apache beam io函數(shù)一起

富國滬深 2022-08-02 16:12:12
我正在嘗試創(chuàng)建一個數(shù)據(jù)流模板,該模板將輸入?yún)?shù)作為.遵循文檔中的示例RuntimeValueimport reimport apache_beam as beamfrom apache_beam.io import ReadFromTextfrom apache_beam.io import WriteToTextfrom apache_beam.options.pipeline_options import PipelineOptions# [START example_wordcount_templated]class WordcountTemplatedOptions(PipelineOptions):  @classmethod  def _add_argparse_args(cls, parser):    # Use add_value_provider_argument for arguments to be templatable    # Use add_argument as usual for non-templatable arguments    parser.add_value_provider_argument(        '--input', help='Path of the file to read from')    parser.add_argument(        '--output', required=True, help='Output file to write results to.')pipeline_options = PipelineOptions(['--output', 'some/output_path'])with beam.Pipeline(options=pipeline_options) as p:  wordcount_options = pipeline_options.view_as(WordcountTemplatedOptions)  lines = p | 'Read' >> ReadFromText(wordcount_options.input)# [END example_wordcount_templated](直接取自官方代碼段)在嘗試使用以下命令創(chuàng)建模板時(填寫詳細信息)時會出現(xiàn)以下錯誤: python -m examples.mymodule \    --runner DataflowRunner \    --project YOUR_PROJECT_ID \    --staging_location gs://YOUR_BUCKET_NAME/staging \    --temp_location gs://YOUR_BUCKET_NAME/temp \    --template_location gs://YOUR_BUCKET_NAME/templates/YOUR_TEMPLATE_NAME  File "lib/python3.7/site-packages/apache_beam/options/value_provider.py", line 139, in _f                                                                  raise error.RuntimeValueProviderError('%s not accessible' % obj)apache_beam.error.RuntimeValueProviderError: RuntimeValueProvider(option: input, type: str, default_value: None) not accessible                                                                                                        文檔還指出:某些 I/O 連接器包含接受 ValueProvider 對象的方法。若要確定對 I/O 連接器及其方法的支持,請參閱連接器的 API 參考文檔。以下 I/O 連接器接受運行時參數(shù):基于文件的 IO:textio、avroio、tfrecordio我不確定為什么示例代碼會給出錯誤。有人可以幫我嗎?對于它的價值,我正在使用:apache-beam = {extras = ["gcp"], version = "^2.19.0"}
查看完整描述

1 回答

?
牧羊人nacy

TA貢獻1862條經驗 獲得超7個贊

這已經固定在光束中,截至2020年4月15日發(fā)布。0.20.0

使用 beam.io 操作(例如運行時值提供程序)只是工作正常。如果您遇到與問題相同的錯誤,請嘗試升級您的梁依賴版本。beam.io.ReadFromText(wordcount_options.input)


查看完整回答
反對 回復 2022-08-02
  • 1 回答
  • 0 關注
  • 146 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號