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
from luigi.format import Format | |
import csvkit | |
class CSVOutputProcessor(object): | |
""" | |
A simple CSV output processor to be hooked into Format's | |
`pipe_writer`. | |
If `cols` are given, the names are used as CSV header, otherwise no | |
explicit header is written. |
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
GaTransactionConf = namedtuple("GaTransactionConf", ["sku", "name", "category"]) | |
class GaTransactionsDict(dict): | |
def __getitem__(self, key): | |
if isinstance(key, GaTransactionConf): | |
updated = False | |
for mapping in self.keys(): | |
if cmp_ga_conf(key, mapping): | |
key = mapping #update the key |