Last active
December 27, 2015 18:39
-
-
Save samuell/7371400 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| class ATask(luigi.Task): | |
| def requires(self): | |
| # Defines what is the upstream task to this one. | |
| # Is later used by the input() function. | |
| return APreviousTask() | |
| def output(self): | |
| return luigi.LocalTarget(self.input().path + ".new_extension") | |
| def run(self): | |
| # Loop over the input file, and just write each line to the output file. | |
| with self.input().open() as infile, self.output().open() as outfile: | |
| for line in infile: | |
| outfile.writeline(line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment