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

___Analyzing Data___ TypeError: '<' not supported between instances of 'int' and 'NoneType' #234

Open
ItzFender opened this issue Jun 25, 2024 · 1 comment

Comments

@ItzFender
Copy link

GarminDB version: 3.6.0
Python version: 3.12.4

Command: garmindb_cli.py --all --download --import --analyze --latest

<- Downloads data Removed for brevity ->

Error:

___Analyzing Data___
Summary Tables Generation:
Traceback (most recent call last):
  File "C:\Users\username\AppData\Local\Programs\Python\Python312\Scripts\garmindb_cli.py", line 368, in <module>
    main(sys.argv[1:])
  File "C:\Users\username\AppData\Local\Programs\Python\Python312\Scripts\garmindb_cli.py", line 355, in main
    analyze_data(args.trace)
  File "C:\Users\username\AppData\Local\Programs\Python\Python312\Scripts\garmindb_cli.py", line 248, in analyze_data
    analyze.summary()
  File "C:\Users\username\AppData\Local\Programs\Python\Python312\Lib\site-packages\garmindb\analyze.py", line 192, in summary
    for year in sorted(list(set(Monitoring.get_years(self.garmin_mon_db) + Activities.get_years(self.garmin_act_db)))):
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '<' not supported between instances of 'int' and 'NoneType'
@ItzFender
Copy link
Author

I ended up finding issue #163 which pointed me in the right direction.

I had 16 rows in my activities table that were completely blank.

View:
select start_time from activities where start_time IS NULL;

Delete:
DELETE from activities WHERE start_time IS NULL;

I don't have a lot of experience with python so I may be way off base, but could you filter out null or empty datetimes in the get_years() method/function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant