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

Parse invalid dates #109

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tap_postgres/sync_strategies/logical_replication.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,10 @@ def selected_value_to_singer_value_impl(elem, og_sql_datatype, conn_info):
if isinstance(elem, datetime.date):
#logical replication gives us dates as strings UNLESS they from an array
return elem.isoformat() + 'T00:00:00+00:00'
return parse(elem).isoformat() + "+00:00"
try:
return parse(elem).isoformat() + "+00:00"
except ValueError:
return parse('9999-12-31T00:00:00+00:00').isoformat()
if sql_datatype == 'time with time zone':
return parse(elem).isoformat().split('T')[1]
if sql_datatype == 'bit':
Expand Down