mirror of
https://github.com/bspeice/metrik
synced 2024-11-23 07:38:09 -05:00
More stable hash ID
This commit is contained in:
parent
98d669eab3
commit
7dc9426eb9
@ -1,10 +1,10 @@
|
|||||||
from luigi import Task, DateParameter, LocalTarget
|
from luigi import WrapperTask, DateParameter, LocalTarget
|
||||||
|
|
||||||
from metrik.tasks.ice import LiborRateTask
|
from metrik.tasks.ice import LiborRateTask
|
||||||
from metrik.targets.temp_file import TempFileTarget
|
from metrik.targets.temp_file import TempFileTarget
|
||||||
|
|
||||||
|
|
||||||
class LiborFlow(Task):
|
class LiborFlow(WrapperTask):
|
||||||
date = DateParameter()
|
date = DateParameter()
|
||||||
|
|
||||||
def requires(self):
|
def requires(self):
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
from __future__ import print_function
|
||||||
from luigi.task import Task
|
from luigi.task import Task
|
||||||
from luigi.parameter import DateParameter, Parameter
|
from luigi.parameter import DateParameter, Parameter
|
||||||
# noinspection PyUnresolvedReferences
|
# noinspection PyUnresolvedReferences
|
||||||
@ -25,7 +26,8 @@ class LiborRateTask(Task):
|
|||||||
currency = Parameter()
|
currency = Parameter()
|
||||||
|
|
||||||
def output(self):
|
def output(self):
|
||||||
return MongoTarget('libor', hash(self.task_id))
|
h = hash(str(self.to_str_params()))
|
||||||
|
return MongoTarget('libor', h)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
libor_record = self.retrieve_data(self.date, self.currency)
|
libor_record = self.retrieve_data(self.date, self.currency)
|
||||||
|
Loading…
Reference in New Issue
Block a user