From 2c7e2cc5914255bc86b36b0ca0477d0b2b712075 Mon Sep 17 00:00:00 2001 From: Kyle Allan Date: Mon, 12 Feb 2018 13:33:47 -0500 Subject: [PATCH 1/3] go back to a format default that works better in ubuntu --- singer/utils.py | 2 +- tests/test_utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/singer/utils.py b/singer/utils.py index 715d695..97bd232 100644 --- a/singer/utils.py +++ b/singer/utils.py @@ -11,7 +11,7 @@ from singer.catalog import Catalog DATETIME_PARSE = "%Y-%m-%dT%H:%M:%SZ" -DATETIME_FMT = "%Y-%m-%dT%H:%M:%S.%fZ" +DATETIME_FMT = "%04Y-%m-%dT%H:%M:%S.%fZ" def now(): return datetime.datetime.utcnow().replace(tzinfo=pytz.UTC) diff --git a/tests/test_utils.py b/tests/test_utils.py index 2b20790..4ef53f0 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -7,7 +7,7 @@ class TestFormat(unittest.TestCase): def test_small_years(self): - self.assertEqual(u.strftime(dt(90, 1, 1, tzinfo=tz.utc), '%04Y-%m-%dT%H:%M:%S.%fZ'), + self.assertEqual(u.strftime(dt(90, 1, 1, tzinfo=tz.utc)), "0090-01-01T00:00:00.000000Z") From 85d7c93083a309650f61c8213765ad963ccbeb7f Mon Sep 17 00:00:00 2001 From: Kyle Allan Date: Mon, 12 Feb 2018 13:42:20 -0500 Subject: [PATCH 2/3] pylint? --- singer/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/singer/utils.py b/singer/utils.py index 97bd232..0b419c6 100644 --- a/singer/utils.py +++ b/singer/utils.py @@ -174,11 +174,11 @@ def exception_is_4xx(exception): def handle_top_exception(logger): """A decorator that will catch exceptions and log the exception's message as a CRITICAL log.""" - def decorator(fn): - @functools.wraps(fn) + def decorator(fnc): + @functools.wraps(fnc) def wrapped(*args, **kwargs): try: - return fn(*args, **kwargs) + return fnc(*args, **kwargs) except Exception as exc: logger.critical(exc) raise From bb215e22f839bcb4a67301df13300395e90bdef6 Mon Sep 17 00:00:00 2001 From: Kyle Allan Date: Mon, 12 Feb 2018 13:56:53 -0500 Subject: [PATCH 3/3] more pylint --- circle.yml | 2 +- singer/transform.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/circle.yml b/circle.yml index 496f2ba..fc975d0 100644 --- a/circle.yml +++ b/circle.yml @@ -8,4 +8,4 @@ dependencies: test: post: - - pylint singer -d missing-docstring,broad-except,bare-except,too-many-return-statements,too-many-branches,too-many-arguments,no-else-return,too-few-public-methods,fixme,protected-access + - pylint singer -d missing-docstring,broad-except,bare-except,too-many-return-statements,too-many-branches,too-many-arguments,no-else-return,too-few-public-methods,fixme,protected-access,too-many-locals,inconsistent-return-statements diff --git a/singer/transform.py b/singer/transform.py index 12df723..1e5f506 100644 --- a/singer/transform.py +++ b/singer/transform.py @@ -1,10 +1,9 @@ import datetime import pendulum +from jsonschema import RefResolver from singer.logger import get_logger from singer.utils import strftime -from jsonschema import RefResolver - LOGGER = get_logger() NO_INTEGER_DATETIME_PARSING = "no-integer-datetime-parsing"