Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

faster date parsing #154

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
url="http://singer.io",
install_requires=[
'pytz>=2018.4',
'jsonschema==2.6.0',
'simplejson==3.11.1',
'jsonschema>=2.6.0',
'simplejson>=3.11.1',
'python-dateutil>=2.6.0',
'backoff==1.8.0',
'backoff>=1.8.0',
'ciso8601',
],
extras_require={
Expand Down
5 changes: 3 additions & 2 deletions singer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import json
import time
from warnings import warn

import ciso8601
import dateutil.parser
import pytz
import backoff as backoff_module
Expand Down Expand Up @@ -58,7 +58,8 @@ def strptime(dtime):
return datetime.datetime.strptime(dtime, DATETIME_PARSE)

def strptime_to_utc(dtimestr):
d_object = dateutil.parser.parse(dtimestr)
# d_object = dateutil.parser.parse(dtimestr)
d_object = ciso8601.parse_datetime(dtimestr)
if d_object.tzinfo is None:
return d_object.replace(tzinfo=pytz.UTC)
else:
Expand Down