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
import luigi | |
import os | |
#from WorkflowUtils import WorkflowUtils | |
import logging as log | |
class ATask(luigi.Task): | |
# Task parameters | |
dataset_name = luigi.Parameter() | |
upstream_task = luigi.Parameter() | |
# Helper classes | |
#utils = WorkflowUtils() | |
def requires(self): | |
return self.upstream_task | |
def output(self): | |
return luigi.LocalTarget(self.input().path + ".CHANGETHIS") | |
def run(self): | |
with gzip.open(self.input().path, "rb") as infile, gzip.open(self.output().path, "wb") as outfile: | |
tsv_reader = csv.reader(infile, delimiter=" ") | |
tsv_writer = csv.writer(outfile, delimiter=" ") | |
for row in tsv_reader: | |
outfile.write(row) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment