fortysix2ahead / tracs

Command line application for managing GPS tracks
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Strava import fails with pydantic error #370

Closed fortysix2ahead closed 2 weeks ago

fortysix2ahead commented 2 weeks ago
pydantic_core._pydantic_core.ValidationError: 2 validation errors for DetailedActivity
start_date_local
  Input should have timezone info [type=timezone_aware, input_value='2024-11-04T15:28:42', input_type=str]
    For further information visit https://errors.pydantic.dev/2.9/v/timezone_aware
laps.0.start_date_local
  Input should have timezone info [type=timezone_aware, input_value='2024-11-04T15:28:42', input_type=str]
    For further information visit https://errors.pydantic.dev/2.9/v/timezone_aware
fortysix2ahead commented 2 weeks ago

Stravalib expects timezone-aware timestamps for both UTC and local start times (probably end times as well). However, Strava delivers a mix of timezoned and naive times. The same is true for laps.

{
  "start_date" : "2024-11-04T14:28:42Z",
  "start_date_local" : "2024-11-04T15:28:42",
  "timezone" : "(GMT+01:00) Europe/Berlin",
}
fortysix2ahead commented 2 weeks ago

Opened a bug report at https://github.com/stravalib/stravalib/issues/598