Last active
April 23, 2020 09:05
-
-
Save riga/cfaec1ffa2cadf373925fa89be0f33c5 to your computer and use it in GitHub Desktop.
Test tasks for Luigi PR https://github.com/spotify/luigi/pull/2932
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
""" | |
Command to run the tasks: | |
luigi --module progress_tasks TaskB --workers 2 | |
""" | |
import time | |
import luigi | |
class TaskA(luigi.Task): | |
interval = luigi.IntParameter() | |
def run(self): | |
self.set_status_message("some task message") | |
for i in range(100): | |
self.set_progress_percentage(i) | |
time.sleep(self.interval) | |
class TaskB(luigi.WrapperTask): | |
def requires(self): | |
return [TaskA(interval=2), TaskA(interval=4)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment