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


Python TestPipeline.get_full_options_as_args方法代码示例

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


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

示例1: test_wordcount_it

# 需要导入模块: from apache_beam.test_pipeline import TestPipeline [as 别名]
# 或者: from apache_beam.test_pipeline.TestPipeline import get_full_options_as_args [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_full_options_as_args [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_append_extra_options

# 需要导入模块: from apache_beam.test_pipeline import TestPipeline [as 别名]
# 或者: from apache_beam.test_pipeline.TestPipeline import get_full_options_as_args [as 别名]
 def test_append_extra_options(self):
   test_pipeline = TestPipeline()
   for case in self.EXTRA_OPT_CASES:
     opt_list = test_pipeline.get_full_options_as_args(**case['options'])
     self.assertListEqual(sorted(opt_list), sorted(case['expected']))
开发者ID:amitsela,项目名称:incubator-beam,代码行数:7,代码来源:test_pipeline_test.py

示例4: test_create_test_pipeline_options

# 需要导入模块: from apache_beam.test_pipeline import TestPipeline [as 别名]
# 或者: from apache_beam.test_pipeline.TestPipeline import get_full_options_as_args [as 别名]
 def test_create_test_pipeline_options(self):
   test_pipeline = TestPipeline(argv=self.TEST_CASE['options'])
   test_options = PipelineOptions(test_pipeline.get_full_options_as_args())
   self.assertDictContainsSubset(self.TEST_CASE['expected_dict'],
                                 test_options.get_all_options())
开发者ID:amitsela,项目名称:incubator-beam,代码行数:7,代码来源:test_pipeline_test.py

示例5: test_empty_option_args_parsing

# 需要导入模块: from apache_beam.test_pipeline import TestPipeline [as 别名]
# 或者: from apache_beam.test_pipeline.TestPipeline import get_full_options_as_args [as 别名]
 def test_empty_option_args_parsing(self):
   test_pipeline = TestPipeline()
   self.assertListEqual([],
                        test_pipeline.get_full_options_as_args())
开发者ID:amitsela,项目名称:incubator-beam,代码行数:6,代码来源:test_pipeline_test.py

示例6: test_option_args_parsing

# 需要导入模块: from apache_beam.test_pipeline import TestPipeline [as 别名]
# 或者: from apache_beam.test_pipeline.TestPipeline import get_full_options_as_args [as 别名]
 def test_option_args_parsing(self):
   test_pipeline = TestPipeline(argv=self.TEST_CASE['options'])
   self.assertListEqual(
       sorted(test_pipeline.get_full_options_as_args()),
       sorted(self.TEST_CASE['expected_list']))
开发者ID:amitsela,项目名称:incubator-beam,代码行数:7,代码来源:test_pipeline_test.py


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