Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import from Strava export fails on manual activities #133

Closed
p3dda opened this issue Aug 5, 2024 · 1 comment
Closed

Import from Strava export fails on manual activities #133

p3dda opened this issue Aug 5, 2024 · 1 comment
Labels
component: Strava Everything related to Strava type: bug Something isn't working

Comments

@p3dda
Copy link

p3dda commented Aug 5, 2024

On manual recorded activities (without .gpx / .fit file), the import from API fails with an exception, because "Filename" is not set in the activities.csv. In this case, row["Filename"] is type float and value NaN.

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/app/geo_activity_playground/__main__.py", line 118, in <module>
    main()
  File "/app/geo_activity_playground/__main__.py", line 93, in main
    options.func(options)
  File "/app/geo_activity_playground/__main__.py", line 67, in <lambda>
    *make_activity_repository(options.basedir, options.skip_strava),
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/geo_activity_playground/__main__.py", line 112, in make_activity_repository
    scan_for_activities(repository, tile_visit_accessor, config, skip_strava)
  File "/app/geo_activity_playground/webui/upload/controller.py", line 103, in scan_for_activities
    import_from_strava_checkout(repository)
  File "/app/geo_activity_playground/importers/strava_checkout.py", line 169, in import_from_strava_checkout
    activity_file = checkout_path / row["Filename"]
                    ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for /: 'PosixPath' and 'float'

This would suggest to check this and skip the import of this activity.

if row["Filename"] is np.nan:
    logger.debug(f"Skipping activity {activity_id} without file.")
    continue
@martin-ueding
Copy link
Owner

Sounds like a good fix, I've added it. Thanks!

@martin-ueding martin-ueding added type: bug Something isn't working component: Strava Everything related to Strava labels Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Strava Everything related to Strava type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants