Skip to content

Commit

Permalink
input: Column "type" is now optional
Browse files Browse the repository at this point in the history
Fixes cram tests and possibly also helps people who use strava-gear
without strava-offline (although I don't think there are any).
  • Loading branch information
liskin committed Nov 2, 2023
1 parent 761257b commit 12e87e1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/strava_gear/input/activities.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ def read_input_csv(inp) -> Tuple[Dict[BikeName, BikeId], List[Dict]]:
"""
activities: List[Dict] = []
for r in csv.DictReader(inp):
assert r.keys() <= {'name', 'gear_id', 'type', 'start_date', 'moving_time', 'distance'}
assert r.keys() <= {'name', 'gear_id', 'start_date', 'moving_time', 'distance'}
activities.append({
**r,
'moving_time': int(r['moving_time']),
'distance': float(r['distance']),
'start_date': parse_datetime(r['start_date']),
'type': None,
})

return {}, activities
Expand Down

0 comments on commit 12e87e1

Please sign in to comment.