Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions tap_slack/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def sync(self, mdata):
# If threads are being synced then the message data for the
# message the threaded replies are in response to will be
# synced to the messages table as well as the threads table
if threads_stream:
if threads_stream and data.get('thread_ts'):
# If threads is selected we need to sync all the
# threaded replies to this message
threads_stream.write_schema()
Expand All @@ -274,9 +274,7 @@ def sync(self, mdata):
schema=schema,
metadata=metadata.to_map(mdata)
)
record_timestamp = \
transformed_record.get('thread_ts', '').partition('.')[
0]
record_timestamp = data.get('ts', '').partition('.')[0]
record_timestamp_int = int(record_timestamp)
if record_timestamp_int >= start.timestamp():
if self.write_to_singer:
Expand Down
6 changes: 1 addition & 5 deletions tap_slack/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,5 @@ def transform_json(stream, data, date_fields, channel_id=None):
for date_field in date_fields:
timestamp = record.get(date_field, None)
if timestamp and isinstance(timestamp, str):
if stream == 'messages' or stream == "threads" and date_field == 'ts':
record['thread_ts'] = timestamp
record[date_field] = decimal_timestamp_to_utc_timestamp(timestamp)
else:
record[date_field] = decimal_timestamp_to_utc_timestamp(timestamp)
record[date_field] = decimal_timestamp_to_utc_timestamp(timestamp)
return data