Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
Fix output format of time fields
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon authored Aug 7, 2024
1 parent b86a4c1 commit ebacc86
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tap_mysql/sync_strategies/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ def row_to_singer_record(catalog_entry, version, row, columns, time_extracted):

elif isinstance(elem, datetime.timedelta):
if property_format == 'time':
row_to_persist += (str(elem),) # this should convert time column into 'HH:MM:SS' formatted string
_total_seconds = int(elem.total_seconds())
_hours, _remainder = divmod(total_seconds, 3600)
_minutes, _seconds = divmod(remainder, 60)
row_to_persist += (f"{hours:02}:{minutes:02}:{seconds:02}",) # this should convert time column into 'HH:MM:SS' formatted string
else:
epoch = datetime.datetime.utcfromtimestamp(0)
timedelta_from_epoch = epoch + elem
Expand Down

0 comments on commit ebacc86

Please sign in to comment.