diff --git a/setup.py b/setup.py index 518fda1..addbe08 100644 --- a/setup.py +++ b/setup.py @@ -19,9 +19,9 @@ classifiers=['Programming Language :: Python :: 3 :: Only'], py_modules=['target_postgres'], install_requires=[ - 'arrow==0.15.5', - 'psycopg2==2.8.5', - 'singer-python==5.9.0' + 'arrow==1.2.3', + 'psycopg2==2.9.5', + 'singer-python==5.13.0' ], setup_requires=[ "pytest-runner" diff --git a/target_postgres/singer_stream.py b/target_postgres/singer_stream.py index 871d1c2..ba2b5fc 100644 --- a/target_postgres/singer_stream.py +++ b/target_postgres/singer_stream.py @@ -72,7 +72,7 @@ def update_schema(self, schema, key_properties): # The validator can handle _many_ more things than our simplified schema, and is, in general handled by third party code self.validator = Draft4Validator(schema, format_checker=FormatChecker()) - properties = self.schema['properties'] + properties = self.schema.get('properties', {}) if singer.RECEIVED_AT not in properties: properties[singer.RECEIVED_AT] = { @@ -182,7 +182,7 @@ def get_batch(self): if 'sequence' in record_message: record[singer.SEQUENCE] = record_message['sequence'] else: - record[singer.SEQUENCE] = arrow.get().timestamp + record[singer.SEQUENCE] = int(arrow.get().timestamp()) records.append(record)