Logging for Travis

master
Bradlee Speice 2016-08-13 00:03:47 -04:00
parent 81741b75ce
commit 313d8ab775
2 changed files with 18 additions and 9 deletions

View File

@ -15,5 +15,14 @@
</value> </value>
</option> </option>
</inspection_tool> </inspection_tool>
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredPackages">
<value>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="pymongo" />
</list>
</value>
</option>
</inspection_tool>
</profile> </profile>
</component> </component>

View File

@ -1,17 +1,15 @@
from __future__ import print_function 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 from luigi.parameter import DateParameter, Parameter
# noinspection PyUnresolvedReferences # noinspection PyUnresolvedReferences
from six.moves.urllib.parse import quote_plus 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 from metrik.tasks.base import MongoCreateTask
LiborRate = namedtuple('LiborRate', [ LiborRate = namedtuple('LiborRate', [
@ -62,7 +60,9 @@ class LiborRateTask(MongoCreateTask):
# the *time* is correct, but very often the date gets screwed up. # 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 # 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. # 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']) dt = parse(row['publication'])
logging.info('Parsed datetime: {}'.format(dt))
dt = dt.replace(year=date.year, month=date.month, day=date.day) dt = dt.replace(year=date.year, month=date.month, day=date.day)
globals()['publication'] = dt globals()['publication'] = dt