allow passing of data type from data source

This commit is contained in:
warren-oneill
2015-06-03 15:10:54 +02:00
parent 9996502573
commit f9d3dbff47
+5 -4
View File
@@ -45,11 +45,12 @@ class DataSource(with_metaclass(ABCMeta)):
"""
Override this to hand craft conversion of row.
"""
row = {target: mapping_func(raw_row[source_key])
for target, (mapping_func, source_key)
in self.mapping.items()}
row.update({'source_id': self.get_hash()})
row = {}
row.update({'type': self.event_type})
row.update({target: mapping_func(raw_row[source_key])
for target, (mapping_func, source_key)
in self.mapping.items()})
row.update({'source_id': self.get_hash()})
return row
@property