You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix timezone-aware vs naive datetime comparison in correlate_git_with_sessions #34
The correlate_git_with_sessions() function in queries.py throws a TypeError when comparing timezone-aware and naive datetime objects. This happens when git commits have timezone information but session timestamps don't (or vice versa).
Current Workaround
Tests skip this case with pytest.skip():
try:
result=correlate_git_with_sessions.fn(days=7)
exceptTypeError:
pytest.skip("Timezone comparison issue in correlate_git_with_sessions")
Expected Behavior
The function should handle both timezone-aware and naive datetimes gracefully, either by:
Normalizing all datetimes to UTC
Stripping timezone info for comparison
Making all timestamps timezone-aware
Files Affected
src/session_analytics/queries.py - correlate_git_with_sessions() function
tests/test_server.py:225-238 - test with skip workaround
tests/test_cli.py:626-630 - CLI test with skip workaround
Activity
fix: Normalize datetimes for timezone-aware vs naive comparison