diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 3dd7c96..1c1045c 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -15,5 +15,14 @@ + + + \ No newline at end of file diff --git a/metrik/tasks/ice.py b/metrik/tasks/ice.py index cded0b9..1744f1a 100644 --- a/metrik/tasks/ice.py +++ b/metrik/tasks/ice.py @@ -1,17 +1,15 @@ from __future__ import print_function -from luigi.task import Task + +import csv +import requests +from collections import namedtuple +from dateutil.parser import parse +from io import StringIO +import logging from luigi.parameter import DateParameter, Parameter # noinspection PyUnresolvedReferences from six.moves.urllib.parse import quote_plus -import pytz -from collections import namedtuple -import requests -import datetime -import csv -from io import StringIO -from dateutil.parser import parse -from metrik.targets.mongo_target import MongoTarget from metrik.tasks.base import MongoCreateTask LiborRate = namedtuple('LiborRate', [ @@ -62,7 +60,9 @@ class LiborRateTask(MongoCreateTask): # the *time* is correct, but very often the date gets screwed up. # When I download the CSV with Firefox I only see the times - when I # download with `requests`, I see both date (often incorrect) and time. + logging.info('Received string for publication time: {}'.format(row['publication'])) dt = parse(row['publication']) + logging.info('Parsed datetime: {}'.format(dt)) dt = dt.replace(year=date.year, month=date.month, day=date.day) globals()['publication'] = dt