diff --git a/setup.cfg b/setup.cfg index 710b29e..1371d63 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,12 +2,12 @@ test=pytest [flake8] -exclude=build, .eggs +exclude=build, .eggs, .tox/* [coverage:run] source=. data_file=.coverage -omit=build, .eggs/* +omit=build, .eggs/*, .tox/* [coverage:report] -omit=build, .eggs/* \ No newline at end of file +omit=build, .eggs/*, .tox/* \ No newline at end of file diff --git a/setup.py b/setup.py index ef21664..a786871 100644 --- a/setup.py +++ b/setup.py @@ -47,7 +47,7 @@ def find_version(*paths): py_modules=['tap-redshift'], packages=find_packages(), install_requires=[ - 'attrs==17.2.0', + 'attrs==18.2.0', 'pendulum==1.2.0', 'singer-python==5.0.4', 'backoff==1.3.2', @@ -59,7 +59,7 @@ def find_version(*paths): tests_require=[ 'pytest-mock>=1.6.3', 'mock>=2.0.0', - 'coverage>=4.4.2', + 'coverage==4.5.1', 'doublex>=1.8.4,<2.0a', 'flake8>=2.6.0,<3.4.1a', 'pyhamcrest>=1.9.0,<2.0a', diff --git a/tap_redshift/__init__.py b/tap_redshift/__init__.py index 473da72..85305f5 100644 --- a/tap_redshift/__init__.py +++ b/tap_redshift/__init__.py @@ -36,7 +36,7 @@ from tap_redshift import resolve -__version__ = '1.0.0b8' +__version__ = '1.0.0b9' LOGGER = singer.get_logger() @@ -277,6 +277,8 @@ def get_stream_version(tap_stream_id, state): def row_to_record(catalog_entry, version, row, columns, time_extracted): row_to_persist = () for idx, elem in enumerate(row): + if isinstance(elem, datetime.date): + elem = elem.isoformat('T') + 'Z' row_to_persist += (elem,) return singer.RecordMessage( stream=catalog_entry.stream, @@ -307,8 +309,8 @@ def sync_table(connection, catalog_entry, state): params = {} if start_date is not None: - formatted_start_date = str(datetime.datetime.strptime( - start_date, '%Y-%m-%dT%H:%M:%SZ')) + formatted_start_date = datetime.datetime.strptime( + start_date, '%Y-%m-%dT%H:%M:%SZ').astimezone() replication_key = metadata.to_map(catalog_entry.metadata).get( (), {}).get('replication-key') @@ -341,7 +343,7 @@ def sync_table(connection, catalog_entry, state): state, tap_stream_id, 'replication_key_value' - ) or formatted_start_date + ) or formatted_start_date.isoformat() if replication_key_value is not None: entry_schema = catalog_entry.schema diff --git a/tox.ini b/tox.ini index d92ce08..12d53ef 100644 --- a/tox.ini +++ b/tox.ini @@ -2,10 +2,9 @@ envlist=py36 [testenv] deps= - coverage + coverage<=4.5.1 flake8 commands= - flake8 . \ - --exclude=./.tox/*,./.eggs/*,./build/* + flake8 . coverage run setup.py test {posargs} - coverage report --omit=./.tox/* --fail-under=70 \ No newline at end of file + coverage report --fail-under=70 \ No newline at end of file