Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
* removed unused import
* renaming activity id for fitfile import (to adapt to the other sources)
  • Loading branch information
ciklista committed Jul 7, 2020
1 parent 19d5474 commit accf118
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions kafka-producer/file/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class FitFileActivityExtractor(ActivityExtractor):

def __init__(self, file_stream):
self.fitfile = FitFile(file_stream)
self.activity_id = uuid.uuid4()
self.activity_id = str(uuid.uuid4())

def get_activity(self, id):
raise NotImplementedError("One fit file always contains data for one activity only")
Expand All @@ -20,7 +20,7 @@ def get_activities(self):
data = []
for record in self.fitfile.get_messages('record'):
record_dict = {metric.name: metric.value for metric in record}
record_dict.update({'activity_id': self.activity_id})
record_dict.update({'activityId': self.activity_id, 'type': 'fitfile_upload'})
data.append(record_dict)
return data

Expand Down
2 changes: 0 additions & 2 deletions kafka-producer/strava/extractor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@

import os
import json
import requests
import os
Expand Down

0 comments on commit accf118

Please sign in to comment.