Skip to content

Instantly share code, notes, and snippets.

@samuell
Created February 28, 2014 10:09
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save samuell/9268516 to your computer and use it in GitHub Desktop.
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