本文整理汇总了Python中luigi.ExternalTask方法的典型用法代码示例。如果您正苦于以下问题:Python luigi.ExternalTask方法的具体用法?Python luigi.ExternalTask怎么用?Python luigi.ExternalTask使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类luigi
的用法示例。
在下文中一共展示了luigi.ExternalTask方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: requires
# 需要导入模块: import luigi [as 别名]
# 或者: from luigi import ExternalTask [as 别名]
def requires(self):
""" ParseAmassOutput depends on AmassScan to run.
TargetList expects target_file as a parameter.
AmassScan accepts exempt_list as an optional parameter.
Returns:
luigi.ExternalTask - TargetList
"""
args = {
"target_file": self.target_file,
"exempt_list": self.exempt_list,
"results_dir": self.results_dir,
"db_location": self.db_location,
}
return AmassScan(**args)
示例2: test_local_path
# 需要导入模块: import luigi [as 别名]
# 或者: from luigi import ExternalTask [as 别名]
def test_local_path(self):
class TestInput(luigi.ExternalTask):
def output(self):
return luigi.LocalTarget('test_input.tsv')
class TestBulkImportFromLocalTarget(TestBulkImport):
def requires(self):
return TestInput()
task = TestBulkImportFromLocalTarget('session-1')
eq_(task.get_path(), os.path.realpath('test_input.tsv'))
示例3: test_s3_path
# 需要导入模块: import luigi [as 别名]
# 或者: from luigi import ExternalTask [as 别名]
def test_s3_path(self):
class TestInput(luigi.ExternalTask):
def output(self):
s3client = luigi.s3.S3Client(aws_access_key_id='test-key', aws_secret_access_key='test-secret')
return luigi.s3.S3Target('s3://test-bucket/test_input.tsv', client=s3client)
class TestBulkImportFromS3Target(TestBulkImport):
def requires(self):
return TestInput()
task = TestBulkImportFromS3Target('session-1')
eq_(task.get_path(), 's3://test-key:test-secret@/test-bucket/test_input.tsv')