当前位置: 首页>>代码示例>>Python>>正文


Python TestPipeline.get_option方法代码示例

本文整理汇总了Python中apache_beam.test_pipeline.TestPipeline.get_option方法的典型用法代码示例。如果您正苦于以下问题:Python TestPipeline.get_option方法的具体用法?Python TestPipeline.get_option怎么用?Python TestPipeline.get_option使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在apache_beam.test_pipeline.TestPipeline的用法示例。


在下文中一共展示了TestPipeline.get_option方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_wordcount_it

# 需要导入模块: from apache_beam.test_pipeline import TestPipeline [as 别名]
# 或者: from apache_beam.test_pipeline.TestPipeline import get_option [as 别名]
  def test_wordcount_it(self):
    test_pipeline = TestPipeline(is_integration_test=True)

    # Set extra options to the pipeline for test purpose
    output = '/'.join([test_pipeline.get_option('output'),
                       test_pipeline.get_option('job_name'),
                       'results'])
    pipeline_verifiers = [PipelineStateMatcher(),
                          FileChecksumMatcher(output + '*-of-*',
                                              self.DEFAULT_CHECKSUM)]
    extra_opts = {'output': output,
                  'on_success_matcher': all_of(*pipeline_verifiers)}

    # Get pipeline options from command argument: --test-pipeline-options,
    # and start pipeline job by calling pipeline main function.
    wordcount.run(test_pipeline.get_full_options_as_args(**extra_opts))
开发者ID:jasonkuster,项目名称:incubator-beam,代码行数:18,代码来源:wordcount_it_test.py

示例2: test_bigquery_tornadoes_it

# 需要导入模块: from apache_beam.test_pipeline import TestPipeline [as 别名]
# 或者: from apache_beam.test_pipeline.TestPipeline import get_option [as 别名]
  def test_bigquery_tornadoes_it(self):
    test_pipeline = TestPipeline(is_integration_test=True)

    # Set extra options to the pipeline for test purpose
    output_table = ('BigQueryTornadoesIT'
                    '.monthly_tornadoes_%s' % int(round(time.time() * 1000)))
    query = 'SELECT month, tornado_count FROM [%s]' % output_table
    pipeline_verifiers = [PipelineStateMatcher(),
                          BigqueryMatcher(
                              project=test_pipeline.get_option('project'),
                              query=query,
                              checksum=self.DEFAULT_CHECKSUM)]
    extra_opts = {'output': output_table,
                  'on_success_matcher': all_of(*pipeline_verifiers)}

    # Get pipeline options from command argument: --test-pipeline-options,
    # and start pipeline job by calling pipeline main function.
    bigquery_tornadoes.run(
        test_pipeline.get_full_options_as_args(**extra_opts))
开发者ID:vikkyrk,项目名称:incubator-beam,代码行数:21,代码来源:bigquery_tornadoes_it_test.py

示例3: test_get_option

# 需要导入模块: from apache_beam.test_pipeline import TestPipeline [as 别名]
# 或者: from apache_beam.test_pipeline.TestPipeline import get_option [as 别名]
 def test_get_option(self):
   name, value = ('job', 'mockJob')
   test_pipeline = TestPipeline()
   test_pipeline.options_list = ['--%s=%s' % (name, value)]
   self.assertEqual(test_pipeline.get_option(name), value)
开发者ID:amitsela,项目名称:incubator-beam,代码行数:7,代码来源:test_pipeline_test.py


注:本文中的apache_beam.test_pipeline.TestPipeline.get_option方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。